API Reference
Class
InactiveUserDetector (ADPlayground)
Helper methods for detecting accounts that never logged on.
Inheritance
- Object
- InactiveUserDetector
Methods
public static IEnumerable<AccountLogonInfo> FilterNeverLoggedIn(IEnumerable<AccountLogonInfo> accounts, Int32 gracePeriodDays) #Returns:
IEnumerable<AccountLogonInfo>Returns accounts created longer than gracePeriodDays ago where both lastLogon and lastLogonTimestamp are either null or zero.
Parameters
- accounts System.Collections.Generic.IEnumerable{ADPlayground.AccountLogonInfo}
- Accounts to evaluate.
- gracePeriodDays System.Int32
- Number of days after creation to allow logon.
Returns
Filtered collection of accounts.
public static IEnumerable<AccountLogonInfo> GetNeverLoggedInAccounts(String domainName, Int32 gracePeriodDays, String forestName = null) #Returns:
IEnumerable<AccountLogonInfo>Queries Active Directory and returns accounts that never logged on.
Parameters
- domainName System.String
- Domain to query. When null or empty all domains in the current or specified forest are scanned.
- gracePeriodDays System.Int32
- Number of days after creation to allow logon.
- forestName System.String = null
- Optional forest to target when domainName is not specified.
Returns
Collection of accounts with zero logons.