Ying Li at myITforum.com

PowerShell & System Center

PowerShell script to list Local Groups on a remote computer

Here is a PowerShell script to list Local Groups on a remote computer

$strComputer = "XYZ"

$computer = [ADSI]("WinNT://" + $strComputer + ",computer")
$computer.name

$group = $computer.psbase.children |where{$_.psbase.schemaclassname -eq "group"}

foreach ($member in $group.psbase.syncroot)
{$member.name}

Posted: Aug 30 2007, 10:32 AM by yli628 | with no comments
Filed under:

Comments

No Comments