PowerTip: Find Members of Critical Groups with PowerShell

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

Comments (4)

  1. Chris Stephens says:

    This is of course assuming you have AD Web Services setup…

    Another suggestion would be Quest ActiveRoles Management Shell for PowerShell.

  2. Florian Frank says:

    Thanks for this snippet 🙂

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

Skip to main content