|
Posted by Pat Hall on March 7, 2006, 9:08 am
Please log in for more thread options Thanks. That did the trick
"CraigMcK" wrote:
> Hi Pat,
>
> You could use WMI to retrieve the local SID, for example copy this script
> (everything between the -=-=-=-=-'s) into notepad and save it as a .vbs file,
> then run it from a command prompt using:
> cscript.exe scriptname.vbs
>
> that will list all the local accounts and their SIDs - there's more info you
> can retrieve too, using the following attributes:
>
> objItem.AccountType
> objItem.Caption
> objItem.Description
> objItem.Disabled
> objItem.Domain
> objItem.FullName
> objItem.LocalAccount
> objItem.Lockout
> objItem.PasswordChangeable
> objItem.PasswordExpires
> objItem.PasswordRequired
> objItem.SIDType
> objItem.Status
>
> -=-=-=-=-
> On Error Resume Next
>
> strComputer = "."
> 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 "Name: " & objItem.Name
> Wscript.Echo "SID: " & objItem.SID
> Wscript.Echo
> Next
> -=-=-=-=-
>
> "Pat Hall" wrote:
>
> > I need to find out what the SID is for a local user account on a Windows
2000
> > server. How do I do that?
> > I know how to find the SID for a domain account - use ADUC.
|