API Reference
ProtectedUsersChecker
Checks that privileged accounts are members of the Protected Users group.
Inheritance
- Object
- ProtectedUsersChecker
Constructors
public ProtectedUsersChecker(Func<String, Task<IEnumerable<String>>> fetchPrivileged = null, Func<String, Task<HashSet<String>>> fetchProtected = null, Func<IEnumerable<String>> enumerateDomains = null, Func<String, IEnumerable<String>> fetchPrivilegedSync = null, Func<String, HashSet<String>> fetchProtectedSync = null) #Initializes a new instance of the ProtectedUsersChecker class.
Parameters
- fetchPrivileged System.Func{System.String,System.Threading.Tasks.Task{System.Collections.Generic.IEnumerable{System.String}}} = null
- Optional function returning privileged account names.
- fetchProtected System.Func{System.String,System.Threading.Tasks.Task{System.Collections.Generic.HashSet{System.String}}} = null
- Optional function returning Protected Users group members.
- enumerateDomains System.Func{System.Collections.Generic.IEnumerable{System.String}} = null
- Optional function returning domains to check.
- fetchPrivilegedSync System.Func{System.String,System.Collections.Generic.IEnumerable{System.String}} = null
- Optional synchronous function returning privileged account names.
- fetchProtectedSync System.Func{System.String,System.Collections.Generic.HashSet{System.String}} = null
- Optional synchronous function returning Protected Users group members.
Methods
public async Task CheckAsync() #TaskChecks membership across all domains in the current forest.
public Void CheckDomain(String domainName = null) #VoidChecks membership for a single domain synchronously and writes warnings for accounts missing protection.
Parameters
- domainName System.String = null
- Target domain name or null for the current domain.
public async Task CheckDomainAsync(String domainName = null) #TaskChecks membership for a single domain and writes warnings for accounts missing protection.
Parameters
- domainName System.String = null
- Target domain name or null for the current domain.
public IEnumerable<String> GetPrivilegedAccounts(String domainName) #IEnumerable<String>Retrieves privileged account names for the specified domain synchronously.
Parameters
- domainName System.String
- Target domain name.
Returns
Collection of SAM account names.
public Task<IEnumerable<String>> GetPrivilegedAccountsAsync(String domainName) #Task<IEnumerable<String>>Retrieves privileged account names for the specified domain.
Parameters
- domainName System.String
- Target domain name.
Returns
Collection of SAM account names.
public HashSet<String> GetProtectedUsers(String domainName) #HashSet<String>Retrieves members of the Protected Users group synchronously.
Parameters
- domainName System.String
- Target domain name.
Returns
Set of SAM account names.
public Task<HashSet<String>> GetProtectedUsersAsync(String domainName) #Task<HashSet<String>>Retrieves members of the Protected Users group.
Parameters
- domainName System.String
- Target domain name.
Returns
Set of SAM account names.