PowerTip: Find Members of Critical Groups with PowerShell

PowerTip: Find Members of Critical Groups with PowerShell

  • Comments 4
  • Likes

Summary: Use Windows PowerShell to find the members of critical groups.

Hey, Scripting Guy! Question How can I use Windows PowerShell to track who is a member of my Domain Admins group?

Hey, Scripting Guy! Answer Use Get-ADGroupMember, and add as many groups as you want to the list by using the
          SamAccountName for the groups:

"Schema Admins", "Domain Admins", "Enterprise Admins" |

foreach {

 $grpname = $_

 Get-ADGroupMember -Identity $_ |

 select @{N='Group'; E={$grpname}}, Name

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • This is of course assuming you have AD Web Services setup...

    Another suggestion would be Quest ActiveRoles Management Shell for PowerShell.

  • Thanks for this snippet :-)

    I can confirm Chris' post. Somehow the AD Web Service died on my test DC, so I only get errors.

  • Good Snippet

  • thank you