1

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

Community
  • 1
  • 1
user1021743
  • 477
  • 4
  • 16

1 Answers1

2

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

user207421
  • 305,947
  • 44
  • 307
  • 483