Click here to get back home

Find SID for a local user Account

 HomeNewsGroups | Search | About
 microsoft.public.windows.server.security    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Find SID for a local user Account Pat Hall 03-06-2006
Posted by Pat Hall on March 6, 2006, 3:05 pm
Please log in for more thread options
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.

Posted by CraigMcK on March 7, 2006, 7:11 am
Please log in for more thread options
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.

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.

Posted by Joe Richards [MVP] on March 18, 2006, 7:50 pm
Please log in for more thread options
sidtoname

http://www.joeware.net/win/free/tools/sidtoname.htm


--
Joe Richards Microsoft MVP Windows Server Directory Services
Author of O'Reilly Active Directory Third Edition
www.joeware.net


---O'Reilly Active Directory Third Edition now available---

http://www.joeware.net/win/ad3e.htm



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.

Similar ThreadsPosted
How could I find invisible user in admin group? August 12, 2005, 8:34 am
Is local system account member of local Administrators group? June 21, 2005, 11:33 am
User Account Created - 624 And User Account Enabled - 626 for Hel October 13, 2005, 1:56 pm
how to use the user account and the computers account to ... March 9, 2007, 10:38 am
Local Administrator Account April 17, 2007, 7:28 pm
Local Administrator as service log on account January 11, 2006, 3:51 am
Re: Copying Local Account Permissions May 9, 2008, 6:50 am
Re: Copying Local Account Permissions May 9, 2008, 2:39 pm
Re-Enabling Local Administrators Account July 3, 2008, 2:37 am
Allowing a local account to log on as batch/service? July 18, 2005, 2:15 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap