A
Angelo Campitelli
Hi,
I'm trying to run the following code on an account in a domain i.e
retrievesid "user","domainname".
The problem is im calling the code for a local administrators account which
has no priveleges in the domain. How do i query this using the security
context of a different user. I want to supply a username and password....
I read this in some WMi documentation.
If you must supply a username and password, you can't use the WMI moniker.
You must use the WMI Scripting Library's SWbemLocator object instead.
Any ideas ?
Function RetrieveSID (strUsername, strComputerordomainname)
Dim objWMIService
Dim objAccount
Set objWMIService = GetObject("winmgmts:\\" & "." & "\root\cimv2")
Set objAccount = objWMIService.Get ("Win32_UserAccount.Name='" &
strUsername &"',Domain='" & strComputerordomainname & "'")
RetrieveSID = objAccount.SID
End Function
I'm trying to run the following code on an account in a domain i.e
retrievesid "user","domainname".
The problem is im calling the code for a local administrators account which
has no priveleges in the domain. How do i query this using the security
context of a different user. I want to supply a username and password....
I read this in some WMi documentation.
If you must supply a username and password, you can't use the WMI moniker.
You must use the WMI Scripting Library's SWbemLocator object instead.
Any ideas ?
Function RetrieveSID (strUsername, strComputerordomainname)
Dim objWMIService
Dim objAccount
Set objWMIService = GetObject("winmgmts:\\" & "." & "\root\cimv2")
Set objAccount = objWMIService.Get ("Win32_UserAccount.Name='" &
strUsername &"',Domain='" & strComputerordomainname & "'")
RetrieveSID = objAccount.SID
End Function