The challange is to change user's AD passwort. I have a TCL Script wrapping ldapmodify to set the passcode, which works:
set unicodePwd [encodePw4ad $pw]
lappend text {dn: $dn}
lappend text {changetype: modify}
lappend text {replace: unicodePwd}
lappend text {unicodePwd:: $unicodePwd}
lappend text {-}
set fn /tmp/ldiff.[clock microseconds].ldif
write_file $fn [subst [join $text \n]]
.....
exec ldapmodify -H $host -D $binddn -x -w $bindpw -f $fn
Using TCL 8.6 with LDAP 1.9.2 Package the code looks:
set unicodePwd [encodePw4ad $pw]
set handle [::ldap::secure_connect $host 636 0]
ldap::bind $handle $binddn $bindpw
#ldap::modify $handle $dn [list postalCode 123456]
ldap::modify $handle $dn [list unicodePwd $unicodePwd]
ldap::unbind $handle
ldap::disconnect $handle
This works for the "postalCode" but not for the "unicodePwd".
LDAP error unwillingToPerform '': 0000001F: SvcErr: DSID-031A12D2, problem 5003 (WILL_NOT_PERFORM), data 0
Any hint to investigate?