PowerTip: Show Group Members with PowerShell

Summary: Use Windows PowerShell to get a list of group members in Active Directory.

Hey, Scripting Guy! Question How can I use Windows PowerShell to regularly show who is in an Active Directory group, for example, Domain Admins?

Hey, Scripting Guy! Answer To show who is in the Domain Admins group in Active Directory, run the following command:

Get-ADGroupMember DomainAdmins

If you’d like to view this in a nicer format, use:

Get-ADGroupMember DomainAdmins | FORMAT-Table

Comments (10)

  1. tommymaynard says:

    Perhaps it is just the page formatting, but the group object DomainAdmins needs a space in between Domain and Admins and then, because the contains a space, it will need single (or double) quotes around the entire group object name.

  2. Chen V says:

    Get-ADGroupMember “Domain Admins”

  3. Kevin says:

    I need help with a powershell script. I am trying the pull the members of a security group along with the description of each user and export it to csv. Any idea would be much appreciated.

  4. Another Kevin says:

    I believe the same script works for that too.

  5. Kevin Bloody Wilson says:

    Get-AdGroupMember ‘Domain Admins’ | FORMAT-Table | Export-CSV -path c:DomainAdmins.xlsx

  6. Kevin Bacon says:

    All these Kevin’s are chumps. This will work (Trust me I’m a movie star) :

    Get-AdGroupMember ‘Domain Admins’ | Export-CSV -path c:DomainAdmins.csv

    Kevin Bacon
    “There are two types of actors: those who say they want to be famous and those who are liars.”

  7. abdul says:


    I was testing this cmdlet in Windows 2008 R2 Domain Controller and I had a Member from a different Forest. I am getting the Following Error:

    Get-ADGroupMember : The operation completed successfully
    At line:1 char:1
    + Get-ADGroupMember "CN=GroupTest1,OU=Performance Test,DC=Testlab3,DC=com" -Server …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (CN=GroupTest1,O…Testlab3,DC=com:ADGroup) [Get-ADGroupMember], ADException
    + FullyQualifiedErrorId : The operation completed successfully,Microsoft.ActiveDirectory.Management.Commands.GetADGroupMember

    Am I missing something here?

  8. Eric M says:

    Do we need to be on the AD server itself?

    I just get an error when trying as Admin on my workstation

    Get-ADGroupMember : The term ‘Get-ADGroupMember’ is not recognized as the name of a cmdlet, function, script file…

  9. ricardo says:

    run import-module activedirectory prior to the Get-ADGroupMember

Skip to main content