I've searched in stackoverflow how to find maxPwdAge for an AD user, and the solution should be something like this.
DirectoryEntry ldapConnection = new DirectoryEntry();
DirectorySearcher ldapSearch = new DirectorySearcher(ldapConnection);
ldapSearch.Filter = "samaccountname=" + stringWithUsername;
SearchResult user = ldapSearch.FindOne();
Now user
contains all user property, but i can't find maxPwdAge
string passowrdExpireTime = user.Properties["maxPwdAge"][0].ToString(); // It works
string passowrdExpireTime = user.Properties["pwdlastset"][0].ToString(); // pwdlastset doesn't exists
User's password does expire in 90 days, as I can find using this powershell command (Get-ADDefaultDomainPasswordPolicy).MaxPasswordAge.TotalDays
.
Am I missing something?