IADsNTPolicy Method: GetAccountsWithPrivilege

GetAccountsWithPrivilege
(
 PrivilegeName As String
) Variant;

Parameters

[in] String PrivilegeName
Name of a privilege. Accounts possessing this privilege will be returned.

Description
It returns the names of all accounts (User or Group) that have a given privilege.

Example

Dim Policy As IADsNTPolicy
Dim AccountNames As Variant
Dim AccountName As Variant
Set Policy = GetObject("NTDS://DomainName/MachineName")
AccountNames = Policy.GetAccountsWithPrivilege ("LOGON_LOCALLY")
For Each AccountName in AccountNames
 Debug.Print AccountName
Next AccountName

 

See Also