2013-08-30 11 views
0
으로 재설정되었습니다.

ADAM에서 사용자 암호를 재설정하려고합니다. 암호 재설정에 대한ADAM 사용자 암호가 C#

PrincipalContext rootPrincipalContext; 
LdapConnection objLdapconnection; 
rootPrincipalContext = new PrincipalContext(ContextType.ApplicationDirectory, host, baseDN, ContextOptions.Negotiate, username, password); 
LdapDirectoryIdentifier identifier = new LdapDirectoryIdentifier(host, Convert.ToInt32(port)); 
NetworkCredential credential = new NetworkCredential(username, password); 
LdapConnection ldapCon = new LdapConnection(identifier, credential); 
ldapCon.AuthType = AuthType.Negotiate; 
objLdapconnection = ldapCon; 

: 그 동안 나는 내가 뭘하려 Accountmanagement의 namesapce

을 사용하고

UserPrincipal existingUsr = UserPrincipal.FindByIdentity(rootPrincipalContext, IdentityType.DistinguishedName, "cn=" + inputName + ",ou=gslab,dc=starfish"); 

existingUsr.SetPassword(userPassvalue); this lines throws exception "directory property can not be found" 

내가 문자열 전혀 확인되지 않은이 비어도 contextOption.secureSocketlayer하지만 아무것도 시도 작동

암호화 된 암호를 제공해야합니까? 또는 어떤 속성을 설정해야합니까? 미리 감사드립니다.

답변

0

그럼 해결책을 얻었습니다. 그냥

ContextOptions.Negotiate 

rootprincipalContext을 인스턴스화하면서 제거하십시오.

SetPassword() 전에 ExpirePasswordNow() 방법을 사용하십시오.