Closed sandrods closed 6 months ago
sandrods, did you manage? I ran in to the same issue as I used the replace_attribute on userPassword in an OS X 10.6 Server Open Directory to no avail.
Yes I did, tough I don't quite remember how. I'll take a look at it tomorrow and get back to you, ok?
Thanks, I appreciate any help in this matter. /M
Hi. It turns out the problem was the encoding of the password, not the method itself.
I used this code: ldap.replace_attribute(user.dn, 'unicodePwd', microsoft_encode_password(new_password))
def microsoft_encode_password(pwd)
ret = ""
pwd = "\"" + pwd + "\""
pwd.length.times{|i| ret+= "#{pwd[i..i]}\000" }
ret
end
It worked out. I don't know if this will work in OD, but it's worth a shot.
Does not work for Windows Server 2008 R2
Hi there... Is there any way to change a user password in AD, since the normal replace_attribute does not work in this case?