API Reference
DomainAdminsCountChecker
Provides functionality to check the number of members in the Domain Admins group.
Inheritance
- Object
- DomainAdminsCountChecker
Constructors
public DomainAdminsCountChecker(Int32 memberLimit = 10, Func<String, Task<List<String>>> fetchAdmins = null, Func<IEnumerable<String>> enumerateDomains = null, Func<String, List<String>> fetchAdminsSync = null) #Initializes a new instance of the DomainAdminsCountChecker class.
Parameters
- memberLimit System.Int32 = 10
- Maximum allowed number of members before a warning is raised.
- fetchAdmins System.Func{System.String,System.Threading.Tasks.Task{System.Collections.Generic.List{System.String}}} = null
- Optional function to retrieve domain admin names for a domain.
- enumerateDomains System.Func{System.Collections.Generic.IEnumerable{System.String}} = null
- Optional function that returns domain names in the forest.
- fetchAdminsSync System.Func{System.String,System.Collections.Generic.List{System.String}} = null
- Optional synchronous function to retrieve domain admin names for a domain.
Methods
public Void CheckCount() #VoidChecks the Domain Admins group membership count for every domain in the forest synchronously.
public async Task CheckCountAsync() #TaskChecks the Domain Admins group membership count for every domain in the current forest.
public Void CheckCountForDomain(String domainName = null) #VoidChecks the Domain Admins group membership count for a specific domain synchronously.
Parameters
- domainName System.String = null
- Target domain name or null for the current domain.
public async Task CheckCountForDomainAsync(String domainName = null) #TaskChecks the Domain Admins group membership count for a specific domain and writes a warning if it exceeds the limit.
Parameters
- domainName System.String = null
- Target domain name or null for the current domain.
public List<String> GetDomainAdmins(String domainName) #List<String>Retrieves members of the Domain Admins group synchronously.
Parameters
- domainName System.String
- Target domain name.
Returns
List of SAM account names.
public Task<List<String>> GetDomainAdminsAsync(String domainName) #Task<List<String>>Retrieves the SAM account names of all members of the Domain Admins group.
Parameters
- domainName System.String
- Target domain name.
Returns
List of SAM account names.
Inherited Methods
Properties
public Int32 MemberLimit { get; set; } #Maximum allowed number of Domain Admins group members.