Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

How to get the user sid from windows 2000 server


  • Please log in to reply

#1
erickp

erickp

    New Member

  • Member
  • Pip
  • 8 posts
Hi

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
  • 0

Advertisements







Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP