Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can an AD user change password when NT_STATUS_PASSWORD_MUST_CHANGE is set #1082

Open
a23s4a opened this issue Feb 27, 2023 · 0 comments
Open

Comments

@a23s4a
Copy link

a23s4a commented Feb 27, 2023

It is often a case in Active Directory when a new user is created or the password of an existing user has been reset with the option "User must change password on the next logon"
Is there a way for such a user to change his password via ldap3?
As I understand, https://ldap3.readthedocs.io/ldap3.extend.microsoft.html requires a successful bind before changing password.
When the option above is set for the user, connection.bind() always returns False.
If I try to change the password without bind it returns False as well:
server = Server('ldap://addc.somedomain.org', get_info=ALL)
conn = Connection(server, user="someuser@somedomain.org", password="P@ASSwword1")
conn.start_tls() => True
conn.bind() => False
dn = 'My well known DN' conn.extend.microsoft.modify_password(user=dn, old_password="P@ASSwword1", new_password="NewPass!#@rd", controls=None) => False`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant