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

Hi, #1134

Open
koushiksuripeddi opened this issue Mar 26, 2024 · 3 comments
Open

Hi, #1134

koushiksuripeddi opened this issue Mar 26, 2024 · 3 comments

Comments

@koushiksuripeddi
Copy link

I am unable to enable the user must change password at next logon option. Tried with below but no luck. Is there any other option available to enable this?

conn.modify(dn, {'pwdLastSet': [(MODIFY_REPLACE, ['0'])]})

conn.modify(dn, {'pwdLastSet': [(MODIFY_REPLACE, ['-1'])]})
@Zamanry
Copy link

Zamanry commented Mar 26, 2024

Are you trying to update this in Active Directory? If so, you need to modify the User-Account-Control attribute as a whole instead.

@koushiksuripeddi
Copy link
Author

I am trying to change the password along with the option as user must change password at next logon enabled. Can you help me here please

@Zamanry
Copy link

Zamanry commented Mar 26, 2024

I would encourage you to read up on the Windows userAccountControl (i.e., User-Account-Control) attribute, not to be confused with User Account Control (UAC) security mechanism (e.g., UAC bypass). You will need to modify the User-Account-Control attribute itself to accomplish your task of forcing change on next logon. Here are couple resources:

My company has as a tool that decodes User-Account-Control. but does not actually encode the attribute itself. The code isn't great, but it may help you start to picture the end goal. See the reference here:

The ldap3 library is only meant to help with LDAP communication and the request/response data structuring. It's on us as the users to take the LDAP data and manipulate it as we need. Therefore, this library will not be able to easily accomplish your task with a function, etc. Best of luck!

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

2 participants