I'm trying to run a script using WMI that will list the Local User Accounts on a machine that I specify. Microsoft provided the following example but said it the LocalAccount property doesn't work on Windows 2000. If the query is "where LocalAccount=True" then how do I query a Win2K machine?
Thanks for the help!
Code:
On Error Resume Next
strComputer = "SERVER1"
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery _
("Select * from Win32_UserAccount Where LocalAccount = True")
For Each objItem in colItems
Wscript.Echo "Caption: " & objItem.Caption
Wscript.Echo "Name: " & objItem.Name
Next
Thanks for the help!