UserPrincipal.FindByLockoutTime(PrincipalContext, DateTime, MatchType) 方法

定義

針對帳戶鎖定時間在指定的日期和時間範圍內的使用者傳回 PrincipalSearchResult<T> 物件的集合。

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

參數

context
PrincipalContext

針對執行的作業指定伺服器或網域的 PrincipalContext 物件。

time
DateTime

DateTime 物件,可識別錯誤密碼嘗試的日期和時間。 這個參數搭配型別參數使用,以判斷傳回的物件帶有錯誤登入嘗試記錄的時間範圍。

type
MatchType

MatchType 列舉值,指定套用至 time 參數的符合型別。

傳回

PrincipalSearchResult<UserPrincipal>

PrincipalSearchResult<T>,包含一或多個 UserPrincipal 物件,如果找不到任何結果則為空集合。

備註

時間會預設為 UTC。 如果您想要以當地時間指定時間,請將物件的 Kind 屬性指定 timeDateTimeKind.Local

適用於