I'm writing a script in vb script and one of the task of this script is getting the sid of a certain user, i am using this code to do this
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set objAccount = objWMIService.Get("Win32_UserAccount.Name='" & userProfile.name & "',Domain='" & WshNetwork.UserDomain & "'")
MsgBox objAccount.SID
I test this in a machine with windows server 2000 and works perfect buy when i run my script in other test machine with windows server 2000 too it gives me this error "SWbemServices: Not found", does anyone knows how to make it work?? or other way to get the user sid in windows server 2000????
Thanks