API Reference
AdminAccountRetrievalService
Service-account and extended admin retrieval helpers.
Inheritance
- Object
- AdminAccountRetrievalService
Methods
GetAdminAccountsAsync(System.String domainName, System.String ouDistinguishedName, System.Threading.CancellationToken cancellationToken) #Asynchronously retrieves comprehensive accounts with adminCount=1 from the specified domain.
Parameters
- domainName System.String
- Domain to query.
- ouDistinguishedName System.String
- Optional OU scope.
- cancellationToken System.Threading.CancellationToken
- Cancellation token.
GetComprehensiveAdminAccounts(System.String domainName, System.String forestName, System.String maxLogonDays, System.Int32 maxPasswordDays, System.Int32 includeDisabledAccounts, System.Boolean ouDistinguishedName, System.Int32 degreeOfParallelism) #Retrieves comprehensive admin account information with configurable filtering.
Parameters
- domainName System.String
- Domain to query. When null, queries all domains in the forest.
- forestName System.String
- Forest name when domainName is null.
- maxLogonDays System.String
- Days since last logon to consider stale.
- maxPasswordDays System.Int32
- Days since password change to consider stale.
- includeDisabledAccounts System.Int32
- Whether to include disabled accounts.
- ouDistinguishedName System.Boolean
- Optional OU scope.
- degreeOfParallelism System.Int32
- Maximum parallelism for domain queries.
Returns
Collection of admin accounts matching the criteria.
GetComprehensiveAdminAccountsAsync(System.String domainName, System.String forestName, System.String maxInactiveLogonDays, System.Int32 maxPasswordAgeDays, System.Int32 includeDisabledAccounts, System.Boolean ouDistinguishedName, System.Threading.CancellationToken cancellationToken) #Gets comprehensive admin account information across domains. Queries for user accounts with adminCount=1 and includes calculated staleness indicators.
Parameters
- domainName System.String
- Specific domain to query. If null, queries all domains in forest.
- forestName System.String
- Specific forest to query. If null, uses current forest.
- maxInactiveLogonDays System.String
- Maximum days since last logon before considering stale.
- maxPasswordAgeDays System.Int32
- Maximum days since password change before considering stale.
- includeDisabledAccounts System.Int32
- Whether to include disabled accounts in results.
- ouDistinguishedName System.Boolean
- Optional OU scope.
- cancellationToken System.Threading.CancellationToken
- Cancellation token.
Returns
Collection of admin account information with calculated staleness indicators.
GetInactivePrivilegedAccounts(System.String domainName, System.DateTime inactiveSince, System.String forestName, System.String ouDistinguishedName) #Returns privileged accounts that have been inactive since the provided UTC threshold.
Parameters
- domainName System.String
- Domain to query. If null or empty, all domains in the current or specified forest are queried.
- inactiveSince System.DateTime
- Logon time cutoff in UTC.
- forestName System.String
- Optional forest to target when domainName is not specified.
- ouDistinguishedName System.String
- Optional OU scope.
GetInactivePrivilegedAccountsAsync(System.String domainName, System.DateTime inactiveSince, System.String forestName, System.String ouDistinguishedName, System.Threading.CancellationToken cancellationToken) #Asynchronously returns privileged accounts that have been inactive since the provided UTC threshold.
Parameters
- domainName System.String
- Domain to query or null to scan all.
- inactiveSince System.DateTime
- Logon time cutoff in UTC.
- forestName System.String
- Optional forest to target when domainName is not specified.
- ouDistinguishedName System.String
- Optional OU scope.
- cancellationToken System.Threading.CancellationToken
- Cancellation token.
GetServiceAccounts(System.String domainName, System.String ouDistinguishedName) #Retrieves accounts that have one or more service principal names set.
Parameters
- domainName System.String
- Domain to query.
- ouDistinguishedName System.String
- Optional OU scope.
Returns
Collection of service accounts.
GetServiceAccountsAsync(System.String domainName, System.String ouDistinguishedName, System.Threading.CancellationToken cancellationToken) #Asynchronously retrieves accounts that have one or more service principal names set.
Parameters
- domainName System.String
- Domain to query.
- ouDistinguishedName System.String
- Optional OU scope.
- cancellationToken System.Threading.CancellationToken
- Cancellation token.
GetStaleAdminAccounts(System.String domainName, System.Int32 maxInactiveDays, System.String forestName, System.String ouDistinguishedName, System.Int32 degreeOfParallelism) #Returns admin accounts that have not logged in for more than maxInactiveDays days.
Parameters
- domainName System.String
- Domain to query. If null or empty, all domains in the current or specified forest are queried.
- maxInactiveDays System.Int32
- Number of days after which an account is considered stale.
- forestName System.String
- Optional forest to target when domainName is not specified.
- ouDistinguishedName System.String
- Optional OU scope.
- degreeOfParallelism System.Int32
- Maximum parallelism for domain queries.
GetStaleAdminAccountsAsync(System.String domainName, System.Int32 maxInactiveDays, System.String forestName, System.String ouDistinguishedName, System.Int32 degreeOfParallelism, System.Threading.CancellationToken cancellationToken) #Asynchronously returns admin accounts that have not logged in for more than the specified days.
Parameters
- domainName System.String
- Domain to query or null to scan all.
- maxInactiveDays System.Int32
- Days after which an account is considered stale.
- forestName System.String
- Optional forest when scanning all domains.
- ouDistinguishedName System.String
- Optional OU scope.
- degreeOfParallelism System.Int32
- Maximum parallelism for domain queries.
- cancellationToken System.Threading.CancellationToken
- Cancellation token.
GetStaleServiceAccounts(System.String domainName, System.Int32 maxPasswordAgeDays, System.Int32 maxInactiveDays, System.String forestName, System.String ouDistinguishedName, System.Int32 degreeOfParallelism) #Returns service accounts exceeding password or inactivity thresholds.
Parameters
- domainName System.String
- Domain to query. When null or empty, all domains in the current or specified forest are scanned.
- maxPasswordAgeDays System.Int32
- Maximum allowed password age in days.
- maxInactiveDays System.Int32
- Number of days after which accounts are considered inactive.
- forestName System.String
- Optional forest to target when domainName is not specified.
- ouDistinguishedName System.String
- Optional OU scope.
- degreeOfParallelism System.Int32
- Maximum parallelism for domain queries.
GetStaleServiceAccountsAsync(System.String domainName, System.Int32 maxPasswordAgeDays, System.Int32 maxInactiveDays, System.String forestName, System.String ouDistinguishedName, System.Int32 degreeOfParallelism, System.Threading.CancellationToken cancellationToken) #Asynchronously returns service accounts exceeding password or inactivity thresholds.
Parameters
- domainName System.String
- Domain to query or null to scan all.
- maxPasswordAgeDays System.Int32
- Maximum allowed password age in days.
- maxInactiveDays System.Int32
- Days after which accounts are considered inactive.
- forestName System.String
- Optional forest when scanning all domains.
- ouDistinguishedName System.String
- Optional OU scope.
- degreeOfParallelism System.Int32
- Maximum parallelism for domain queries.
- cancellationToken System.Threading.CancellationToken
- Cancellation token.