Contributing this handy script to the collective memory, because I always forget how to do this:
This little blob of VBScript converts from a Windows account name to the associated SID:
strComputer = "."Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")Set objAccount = objWMIService.Get _("Win32_UserAccount.Name='user',Domain='domain'")Wscript.Echo objAccount.SIDIt works equally well for local accounts (pass your machine name for 'Domain') and system accounts (ask for Win32_SystemAccount.Name instead of Win32_UserAccount.Name).
Hopefully the number of times you will need to do this will asymptotically approach zero, but I'm blogging it just in case I ever need to use httpcfg.exe on XPSP2 :)
For more details, see http://www.microsoft.com/technet/scriptcenter/resources/qanda/dec04/hey1203.mspx
