Question

I want to add code that helps me to reset LDAP user password , but as I searched I must have the old password to reset the and add the new password . How could I reset the password without having the old one.

I looked into that link , but it ended with solution contains the usage of the old password LDAP changing user password on Active Directory

final Modification _delete_old_modification = new Modification(ModificationType.DELETE, "unicodePwd", ('"' + oldPassword + '"').getBytes("UTF-16LE"));
final Modification _add_new_modification = new Modification(ModificationType.ADD, "unicodePwd", ('"' + newPassword + '"').getBytes("UTF-16LE"));

Thanks

Was it helpful?

Solution

Get rid of the first line, and change the modification type in the second to REPLACE.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top