Search code examples
windowscommand-lineactive-directorysystem-administration

List groups that are members of other groups in Active Directory domain


How can I find full members (users and groups) of a domain?

Similar as to 'net localgroup Administrators' reports both - users and groups that are members of group Administrators, however similar command in relation to domain 'net group /domain ' lists only members (not groups). Is there a simple way (w/o Powershell to accomplish this task)?


Solution

  • dsget and dsquery are the likely candidates here (depending on OS you are trying for)

    You can try this (I'm not at a DC to test it at the moment)

    Groups are

    dsquery group DC=Contoso,DC=Com
    

    User's should be

    dsquery user dc=ms,dc=tld 
    

    Also note you can pipe from one command to another - ie get groups then users

    dsquery group DC=contoso,DC=com -name yourgroup | dsget group -members 
    

    You can try without -name and see if it works.