SID

  • Thread starter Thread starter mr. plow
  • Start date Start date
I can't take credit for this... I googled and found this awhile back but it
seems to work. This is how I tested fbreseal.

WScript.Echo "User SID: " & GetUserSID

Function GetUserSID()
Dim sUserSID, oWshNetwork, oUserAccount

Set oWshNetwork = CreateObject("WScript.Network")
sUserSID = ""

On Error Resume Next
Set oUserAccount=GetObject( _
"winmgmts://" & oWshNetwork.UserDomain & "/root/cimv2") _
.Get("Win32_UserAccount.Domain='" & oWshNetwork.ComputerName & "'" _
& ",Name='" & oWshNetwork.UserName & "'")

GetUserSID = oUserAccount.SID
End Function

HTH... Doug
 
mr. plow,

Check out [HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList]
key. You will see all the SIDs there.
Also, if you load a user profile - you will see the SID assigned.

Another way - GetTokenInformation API.

Also, IIRC, newsid.exe from sysinternals.com has an option to show current
SID. But I don't remember this exactly.


KM
 
Back
Top