Ying Li at myITforum.com

PowerShell & System Center

PowerShell script to list Local Users on a remote computer

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

$strComputer = "XYZ"

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

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

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

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

Comments

No Comments