【发布时间】:2013-08-30 06:16:23
【问题描述】:
我正在尝试在 ADAM 中重置用户密码。为此,我正在使用 Accountmanagement 命名空间
我尝试了什么:
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;
密码重置:
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 但没有任何效果
我需要提供加密密码吗?还是我需要设置任何属性?提前致谢。
【问题讨论】:
标签: active-directory ldap ldap-query adam