I\'m wrestling with Active Directory, trying to get it to let me change a password. I\'ve found tons of useful information, but I\'m still getting a persistent error.
My guess is "unicodePwd: " + '"' + newPass + '"'
is circumventing your encoding (as String
has to be converted to bytes again and I bet it's not using the right encoding).
Try using the version of MofifyRequest that takes Modification
objects and then use the constructor that takes the attributes value as bytes.
val newPass = "\"Jfi8ZH8#k\"".getBytes("UTF-16LE")
// note the dquotes inside the string
val mod = new Modification(ModificationType.REPLACE, "unicodePwd", newPass)
just like in the blog post you linked to...