WMI Security
- From: "Angelo Campitelli" <campitellian@xxxxxxxxxxxxxx>
- Date: Tue, 17 May 2005 16:29:47 +1000
Howdy,
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 to allow a normal user (strAuthUsername)
to retieve the SID properties through WMI ?
I've tried adding the user im connecting with (strAuthUsername) to the WMI
root in the WMI management console and giving them full permissions (as
well as giving them read permission in active directory to the accounts).
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) ' connect to the remote pc under the
strAuthUsername security context
objService.Security_.ImpersonationLevel =
wbemImpersonationLevelImpersonate ' impersonate them
objservices.Security_.AuthenticationLevel =
wbemAuthenticationLevelPktPrivacy ' set packet security
Set objAccount = objService.Get ("Win32_UserAccount.Name='" &
strUsername &"',Domain='" & strComputerOrDomainname & "'") ' bind to user
account
RetrieveSID = objAccount.SID ' get user sid
End If
.
- Prev by Date: Re: Non-Admin access to Win32_DiskDrive, Win32_PNPEntity
- Next by Date: HOW TO Assign wmi rights to non-administrators!
- Previous by thread: Populate computers with description
- Next by thread: HOW TO Assign wmi rights to non-administrators!
- Index(es):
Relevant Pages
|