Share via


AdvancedFilters.LastPasswordSetTime(DateTime, MatchType) 메서드

정의

LastPasswordSet 특성에 대한 쿼리 필터를 지정된 DateTime 및 지정된 비교 값으로 설정합니다.

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

매개 변수

passwordSetTime
DateTime

DateTime 개체입니다.

match
MatchType

passwordSetTime이 비교에 사용되는 방식을 지정하는 MatchType입니다.

예제

// 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.LastPasswordSetTime(DateTime.Now.AddDays(-30), MatchType.LessThan);  

// Create a PrincipalSearcher object.  
PrincipalSearcher ps = new PrincipalSearcher(usr);  
PrincipalSearchResult<Principal> results = ps.FindAll();  

//Force users who have not changed their password in the last  
//30 days to do so at next logon  
foreach (UserPrincipal u in results)  
{  
	u.ExpirePasswordNow();  
	u.Save();  
}  

설명

시간은 기본적으로 UTC로 설정됩니다. 현지 시간으로 시간을 지정하려면 개체의 속성을 로 DateTimeKind.Local지정 Kind 합니다DateTime.

적용 대상

추가 정보