WhoAmI

The easies way to know your group membership details, SID values, etc. A developer must have WhoAmI.

Update 2007-06-05. You can probe for WhoAmI information by WMI (see WMI Code Creator). If you’re looking just for SID numbers of a particular group’s, here an example script:

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( "SELECT * FROM Win32_Group  where Caption like 'DOMAIN\\PREFIX%'",,48)
For Each objItem in colItems
   Wscript.Echo "-----------------------------------"
   Wscript.Echo "Caption: " & objItem.Caption
   Wscript.Echo "SID    : " & objItem.SID
Next

There is a nice WQL (SQL for WMI) documentation on MSDN.

Leave a Reply

Back to Top