October 20th, 2013

PowerTip: Find Members of Critical Groups with PowerShell

Doctor Scripto
Scripter

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

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.

Feedback