UserPrincipal.FindByLockoutTime(PrincipalContext, DateTime, MatchType) Method

Definition

Returns a collection of PrincipalSearchResult<T> objects for users that have an account lockout time in the specified date and time range.

public static System.DirectoryServices.AccountManagement.PrincipalSearchResult<System.DirectoryServices.AccountManagement.UserPrincipal> FindByLockoutTime (System.DirectoryServices.AccountManagement.PrincipalContext context, DateTime time, System.DirectoryServices.AccountManagement.MatchType type);

Parameters

context
PrincipalContext

The PrincipalContext object that specifies the server or domain against which operations are performed.

time
DateTime

A DateTime object that identifies the date and time of the incorrect password try. This parameter is used with the type parameter to determine the range of time in which the returned objects have an incorrect logon try recorded.

type
MatchType

A MatchType enumeration value that specifies the type of match that is applied to the time parameter.

Returns

A PrincipalSearchResult<T> that contains one or more UserPrincipal objects, or an empty collection if no results are found.

Remarks

The time will default to UTC. If you want to specify the time in local time, then specify the Kind property of the time object as DateTimeKind.Local.

Applies to

Product Versions
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)