'Windows AD unable to reset password from code
From code trying to reset AD user password and using the same password further to login from other services. But AD is not authenticating the user.
In AD we are updating userPassword, holcimIsRegistered and userAccountControl attributes from our code to reset the password.
When we are manually resetting AD user password from ADSI (right click on user -> go to reset password → reset the password) then AD is authenticating the user with the new password. Neither userPassword nor unicodePwd attributes are getting updated.
We tried to update unicodePwd attribute from ADSI and code also but it's not allowing user to update it's value, from code we have observed
[LDAP: error code 53 - 0000001F: SvcErr: DSID-031A12D2, problem 5003 (WILL_NOT_PERFORM)]
We compared user details before and resetting password from ADSI and observed that few details are getting
updated (BadLogonCount:0, badPasswordTime:0, badPwdCount:0, lastLogoff:0, lastLogon:0, logonCount:0, Modified, modifyTimeStamp, msDS-User-Account-Control-Computed, PasswordExpired:false, PasswordLastSet, uSNChanged and whenChanged).
When we tried to modify usnChanged, msDS-User-Account-Control-Computed from ADSI then observed that these two attributes were not editable from ADSI and from code it was giving SchemaViolationException. For passwordExpired and badLogonCount attributes , we faced NoSuchAttributeException while modifying it from code and from ADSI these two attributes were missing.
How else we can make this work?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
