Eu uso o seguinte Script VB, em vez de instalar utilitários adicionais. Eu não posso levar crédito pelos componentes individuais, apenas a combinação deles:
Lookup_SID.vbs
strComputer = "."
Set objWMIService = GetObject("winmgmts:\" & strComputer & "\root\cimv2")
UserName = UserInput( "Enter the user name:", "" )
Domain = UserInput( "Enter the domain / PC name:", "")
Set objAccount = objWMIService.Get _
("Win32_UserAccount.Name='" & UserName & "',Domain='" & Domain & "'")
Call UserInput( "The SID for " & Domain & "\" & UserName & " is: ", objAccount.SID )
Function UserInput( myPrompt, default_text )
' This function prompts the user for some input.
' When the script runs in CSCRIPT.EXE, StdIn is used,
' otherwise the VBScript InputBox( ) function is used.
' myPrompt is the the text used to prompt the user for input.
' The function returns the input typed either on StdIn or in InputBox( ).
' Written by Rob van der Woude
' http://www.robvanderwoude.com
' Check if the script runs in CSCRIPT.EXE
If UCase( Right( WScript.FullName, 12 ) ) = "\CSCRIPT.EXE" Then
' If so, use StdIn and StdOut
WScript.StdOut.Write myPrompt & " "
UserInput = WScript.StdIn.ReadLine
Else
' If not, use InputBox( )
UserInput = InputBox( myPrompt,, default_text )
End If
End Function