PowerTip: Show Group Members with PowerShell

PowerTip: Show Group Members with PowerShell

  • Comments 13
  • Likes

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

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • 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.

  • Get-ADGroupMember "Domain Admins"

  • 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.

  • I believe the same script works for that too.

  • Get-AdGroupMember 'Domain Admins' | FORMAT-Table | Export-CSV -path c:\DomainAdmins.xlsx

  • 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.”

  • Said and done: http://blogs.technet.com/b/askpfeplat/archive/2012/07/16/too-many-admins-in-your-domain-expose-the-problem-s-and-find-a-solution-don-t-forget-powershell.aspx