PowerShell script to find all Local Users on a remote computer

Posted on March 23rd, 2009 in Active Directory, Microsoft, Scripts, Server 2008, Vista by Gil Kreslavsky

$strComputer = "ComputerName"
$computer = [ADSI]("WinNT://" + $strComputer + ",computer")
$computer.name
$Users = $computer.psbase.children |where{$_.psbase.schemaclassname -eq "User"}
foreach ($member in $Users.psbase.syncroot)
{$member.name}

Related Articles

Post a comment

CommentLuv Enabled





Search Kreslavsky.com
Custom Search