WMI Security
- From: "Angelo Campitelli" <campitellian@xxxxxxxxxxxxxx>
- Date: Mon, 16 May 2005 11:31:18 +1000
Im running running the follwing code to connect to one of my domain
controllers and retrieve the SID for a user account. The works fine with the
domain administrator account but not for a normal user..
What permissions fo i need to set?
Ive tried adding the user im connecting with (strAuthUsername) to the WMI
root in the WMI management console and giving them full permissions.
Is their somewhere else i need to set permissions to allow remote
connections by non admin users?
RetrieveSID (strComputer, strUsername,
strComputerOrDomainname,strAuthUsername,strAuthPassword)
Dim objWMIService
Dim objAccount
Dim mySID
Dim objLocator
Dim objService
RetrieveSID = -1
On Error Resume Next
wbemImpersonationLevelImpersonate = 3
wbemAuthenticationLevelPktPrivacy = 6
Set objLocator = CreateObject("WbemScripting.SWbemLocator")
Set objService = objLocator.ConnectServer (strComputer, "root\cimv2",
strAuthUsername, strAuthPassword)
objService.Security_.ImpersonationLevel =
wbemImpersonationLevelImpersonate
objservices.Security_.AuthenticationLevel =
wbemAuthenticationLevelPktPrivacy
Set objAccount = objService.Get ("Win32_UserAccount.Name='" &
strUsername &"',Domain='" & strComputerOrDomainname & "'")
RetrieveSID = objAccount.SID
End If
.
- Prev by Date: Re: Win32Reg_AddRemovePrograms
- Next by Date: Re: root\CIMV2\Win32_Processor
- Previous by thread: Re: Win32Reg_AddRemovePrograms
- Next by thread: Computer Serial
- Index(es):
Loading