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

Add ms-Mcs-AdmPwdExpirationTime to list of attributes with formatter format_ad_timedelta #1070

Closed
floek opened this issue Dec 21, 2022 · 2 comments

Comments

@floek
Copy link

floek commented Dec 21, 2022

ms-Mcs-AdmPwdExpirationTime holds the expiration time for LAPS passwords and is formatted in ms epoch time.

Would be great if it could be added, so it gets formatted as a date.

@ThePirateWhoSmellsOfSunflowers
Copy link
Contributor

ThePirateWhoSmellsOfSunflowers commented Dec 21, 2022

Hello,

You can use a custom formatter to do that:

from ldap3.protocol.formatters.formatters import *

formatter = { 'ms-Mcs-AdmPwdExpirationTime': format_ad_timestamp}
ldap_server = ldap3.Server('{}://{}'.format(ldap_scheme, domain_controller), formatter=formatter)

🌻

@floek
Copy link
Author

floek commented Dec 22, 2022

Thank you, it works. I've also used the validator validate_ad_timestamp.

@floek floek closed this as completed Dec 22, 2022
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