UserPrincipal.FindByExpirationTime(PrincipalContext, DateTime, MatchType) 方法
定义
返回用户的 PrincipalSearchResult<T> 对象集合,其具有指定日期和时间范围内的帐户过期时间。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)
参数
- context
- PrincipalContext
PrincipalContext 对象,用于指定要对其执行操作的服务器或域。The PrincipalContext object that specifies the server or domain against which operations are performed.
- time
- DateTime
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
MatchType 枚举值,用于指定应用到 time 参数的匹配类型。A MatchType enumeration value that specifies the type of match that is applied to the time parameter.
返回
一个 PrincipalSearchResult<T>,其包含一个或多个 UserPrincipal 对象的;如果未找到任何结果,则为空集合。A PrincipalSearchResult<T> that contains one or more UserPrincipal objects, or an empty collection if no results are found.
注解
此时间将默认为 UTC。The time will default to UTC. 如果要以本地时间指定时间,请将对象的属性指定 Kind time 为 DateTimeKind.Local 。If you want to specify the time in local time, then specify the Kind property of the time object as DateTimeKind.Local.