At first, please forgive my English, it is not my mother tongue.
I'm working on a web platform that manages Active Directory. I can create, delete and edit a group, user, OU, and so on.
When a connected user wants to change his own password with the platform, it fails.
It comes from DirectoryEntry.Invoke
.
I used the DirectoryServices.DirectoryEntry
:
directoryEntry.Invoke("SetPassword", password);
directoryEntry.Commit();
So I tried System.DirectoryServices.AccountManagement:
PrincipalContext ctx = new PrincipalContext(ContextType.Machine);
UserPrincipal user = UserPrincipal.FindByIdentity(ctx, Username);
user.SetPassword(password_);
user.Save();
Different way, same problem.
It only fails when a user tries to edit his own password.
Any help would be grateful.