Monthly Archive: October 2010

Oct 01

How to: List members of the Administrators local group

This is a simple powershell script that will list all the members in the Administrators local group. Just add all the computer name in C:\Servers.txt. $Computers = Get-Content "C:\servers.txt" foreach ($Computer in $Computers) {     $strcomputer = [ADSI]("WinNT://" + $Computer + ",computer")     $Group = $strcomputer.psbase.children.find("Administrators")     $members= $Group.psbase.invoke("Members") | %{$_.GetType().InvokeMember("Name", ‘GetProperty’, …

Continue reading »