Sdílet prostřednictvím


AdvancedFilters.AccountLockoutTime(DateTime, MatchType) Metoda

Definice

AccountLockoutTime Nastaví filtr dotazu na zadaný typ času a porovnání.

public:
 void AccountLockoutTime(DateTime lockoutTime, System::DirectoryServices::AccountManagement::MatchType match);
public void AccountLockoutTime (DateTime lockoutTime, System.DirectoryServices.AccountManagement.MatchType match);
member this.AccountLockoutTime : DateTime * System.DirectoryServices.AccountManagement.MatchType -> unit
Public Sub AccountLockoutTime (lockoutTime As DateTime, match As MatchType)

Parametry

lockoutTime
DateTime

Objekt DateTime .

match
MatchType

A MatchType , který určuje, jak lockoutTime se má použít při porovnání.

Příklady

// Create the principal context for the usr object.  
PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "fabrikam.com", "CN=Users,DC=fabrikam,DC=com", "administrator", "SecurelyStoredPassword");  

// Create the principal user object from the context  
UserPrincipal usr = new UserPrincipal(ctx);  

// Set the advanced query filter  
usr.AdvancedSearchFilter.AccountLockoutTime(DateTime.Now.AddDays(-1), MatchType.GreaterThan);  

// Create a PrincipalSearcher object.  
PrincipalSearcher ps = new PrincipalSearcher(usr);  

PrincipalSearchResult<Principal> results = ps.FindAll();  

//Print user names of all accounts locked within the last 24 hours.  

foreach (UserPrincipal u in results)  
{  
  Console.WriteLine(u.Name);  
 }  

Poznámky

Výchozí čas bude UTC. Pokud chcete zadat čas v místním čase, zadejte vlastnost objektu KindDateTime jako DateTimeKind.Local.

Platí pro

Viz také