So ändern Sie unicodePwd?
Hashtable<String, String> environment = new Hashtable<String, String>();
environment.put(LdapContext.CONTROL_FACTORIES,"com.sun.jndi.ldap.ControlFactory ");
environment.put("javax.security.sasl.policy.noplaintext", "true");
environment.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
environment.put(Context.PROVIDER_URL, "ldap://url:389/");
environment.ut(Context.SECURITY_AUTHENTICATION, "DIGEST-MD5 GSSAPI");
environment.put(Context.SECURITY_PROTOCOL, "sasl");
environment.put(Context.SECURITY_PRINCIPAL, "admin");
environment.put(Context.SECURITY_CREDENTIALS, "password");
try {
System.out.println("nine");
DirContext ctx = new InitialDirContext(environment);
System.out.println("ten");
String oldPass = "" + "3qgYl3R2oh7Rwo6" + "";
String newPass = "" + "3qgYl3R2oh7Rwo5" + "";
ModificationItem[] modificationItems = new ModificationItem[2];
modificationItems[0] = new ModificationItem(
DirContext.REMOVE_ATTRIBUTE, new BasicAttribute(
"unicodePwd", oldPass.getBytes("UTF-16LE")));
modificationItems[1] = new ModificationItem(
DirContext.ADD_ATTRIBUTE, new BasicAttribute("unicodePwd",
newPass.getBytes("UTF-16LE")));
// modificationItems[0] = new ModificationItem(
// DirContext.REPLACE_ATTRIBUTE, new BasicAttribute(
// "unicodePwd", newPass.getBytes("UTF-16LE")));
try {
ctx.modifyAttributes("CN=xxx,OU=xx,OU=xx,DC=xx,DC=xxx,DC=xx",
modificationItems);
} catch (NamingException e) {
e.printStackTrace();
}
ctx.close();
} catch (NamingException | UnsupportedEncodingException e) {
e.printStackTrace();
System.out.println(e.getMessage().trim());
}
Bekomme ich die folgende Fehlermeldung.
636 ssl-port geschlossen.
So ändern Sie unicodePwd?
Können Sie mir helfen, bitte?
LDAP: error code 53 - 00002077: SvcErr: DSID-03190F0A, problem 5003 (WILL_NOT_PERFORM)
InformationsquelleAutor Batuhan ÇIKRIKCI | 2013-07-02
Du musst angemeldet sein, um einen Kommentar abzugeben.
Haben wir ein Beispiel, das wir kennen, funktioniert auf W3k.
http://ldapwiki.com/wiki/Example%20-%20Active%20Directory%20Change%20Password%20JNDI
Aber Ihre Probleme ist, dass die Microsoft Active Directory ERFORDERT, dass alle Passwort-Einstellungen werden über eine sichere Verbindung. Die wir auch abdecken: http://ldapwiki.com/wiki/Setting%20and%20Changing%20Microsoft%20Active%20Directory%20Passwords
Hinzufügen LDAPS-Unterstützung social.technet.microsoft.com/wiki/contents/articles/...
InformationsquelleAutor jwilleke