TestimoX

API Reference

Class

InactiveUserDetector (Users)

Namespace ADPlayground.Users
Assembly ADPlayground
Modifiers static

Detects accounts that have not logged on since a configurable grace period.

Inheritance

  • Object
  • InactiveUserDetector

Methods

public static IEnumerable<AccountLogonInfo> FilterInactiveAccounts(IEnumerable<AccountLogonInfo> accounts, Int32 gracePeriodDays) #
Returns: IEnumerable<AccountLogonInfo>

Filters accounts that have not logged on since gracePeriodDays.

Parameters

accounts System.Collections.Generic.IEnumerable{ADPlayground.AccountLogonInfo} requiredposition: 0
Accounts to evaluate.
gracePeriodDays System.Int32 requiredposition: 1
Number of days of allowed inactivity.

Returns

Collection of inactive accounts.

public static IEnumerable<AccountLogonInfo> GetInactiveAccounts(String domainName, Int32 gracePeriodDays, String forestName = null) #
Returns: IEnumerable<AccountLogonInfo>

Queries Active Directory and returns accounts inactive since the specified grace period. Uses multi-domain LDAP queries with automatic domain iteration and error handling.

Parameters

domainName System.String requiredposition: 0
Domain to query. When null or empty all domains in the current or specified forest are scanned.
gracePeriodDays System.Int32 requiredposition: 1
Number of days of allowed inactivity.
forestName System.String = null optionalposition: 2
Optional forest to target when domainName is not specified.

Returns

Collection of inactive accounts.

MapToAccountLogonInfo(System.DirectoryServices.SearchResult result, System.DateTime threshold) #

Maps LDAP search result to AccountLogonInfo with inactive account filtering. Returns null for accounts that do not meet inactive criteria for performance optimization.

Parameters

result System.DirectoryServices.SearchResult required
LDAP search result
threshold System.DateTime required
Date threshold for determining inactivity

Returns

AccountLogonInfo for inactive accounts, null for active accounts