How to check when user's password has expired in Active Directory LDS (ADAM), programmatically?

寵の児 提交于 2020-01-05 05:47:08

问题


Is there a way to check whether a user's password has expired in a Active Directory Lightweight Directory Services instance? Specifically, is there a property (hopefully a boolean) that defines whether the password expired, taking into consideration whether the user's password is past expiration date and also whether the user's password is set to expire at all (in which case it should always return false).

We're trying to query Active Directory for this information using the DirectoryEntry API and the PrincipalContext API, but can't figure out where it is stored. Just querying the pwdLastSet won't be enough since we don't have access to the expiration period for the domain, and we want to be able to support the in-place password policy.


回答1:


Inspect the userAccountControl attribute.



来源:https://stackoverflow.com/questions/13770808/how-to-check-when-users-password-has-expired-in-active-directory-lds-adam-pr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!