Edytuj

Udostępnij za pośrednictwem


UserPrincipal.FindByExpirationTime Method

Definition

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

public:
 static System::DirectoryServices::AccountManagement::PrincipalSearchResult<System::DirectoryServices::AccountManagement::UserPrincipal ^> ^ FindByExpirationTime(System::DirectoryServices::AccountManagement::PrincipalContext ^ context, DateTime time, System::DirectoryServices::AccountManagement::MatchType type);
public static System.DirectoryServices.AccountManagement.PrincipalSearchResult<System.DirectoryServices.AccountManagement.UserPrincipal> FindByExpirationTime (System.DirectoryServices.AccountManagement.PrincipalContext context, DateTime time, System.DirectoryServices.AccountManagement.MatchType type);
static member FindByExpirationTime : System.DirectoryServices.AccountManagement.PrincipalContext * DateTime * System.DirectoryServices.AccountManagement.MatchType -> System.DirectoryServices.AccountManagement.PrincipalSearchResult<System.DirectoryServices.AccountManagement.UserPrincipal>
Public Shared Function FindByExpirationTime (context As PrincipalContext, time As DateTime, type As MatchType) As PrincipalSearchResult(Of UserPrincipal)

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