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