zakird / pyad

Python Active Directory Tools | *Not actively maintained*
http://zakird.github.io/pyad/
176 stars 72 forks source link

Expiration date of password (password never expired ) #72

Open pvhung1 opened 7 years ago

pvhung1 commented 7 years ago

From docs , you mention about expiration date of password . But in source def set_expiration(self, dt): self._ldap_adsi_obj.AccountExpirationDate = dt self._flush()

It is account expiration date, not password expired . Also no method for password never expired .

Kipjr commented 6 years ago

user.get_attribute("msDS-UserPasswordExpiryTimeComputed") //readonly user.get_attribute("pwdLastSet") //Writeable

msDS-UserPasswordExpiryTimeComputed = USER:pwdLastSet + Effective-MaximumPasswordAge (where Effective-MaximumPasswordAge is defined in MS-SAMR section 3.1.1.5).

msDS-UserPasswordExpiryTimeComputed: This is based on Effective-MaximumPasswordAge (A 64-bit value with delta time syntax, indicating the policy setting for the maximum time allowed before a password reset or change is required) http://ldapwiki.com/wiki/MsDS-UserPasswordExpiryTimeComputed https://msdn.microsoft.com/en-us/library/cc245830.aspx

stevenpitts commented 5 years ago

Use aduser.get_expiration instead; constructed values (like msDS-UserPasswordExpiryTimeComputed) are difficult to work with.