Last post Nov 03, 2008 02:43 PM by jnsuryaprakash
Nov 03, 2008 01:35 PM|neha8000|LINK
How can I find out in how many days a password will expire. I need to send a notification to users when password expire in less that 15 days.
I know I can find out when it gets locked and expired by following LOCKOUT = 0x0010;PASSWORD_EXPIRED = 0x800000; So I mainly check the value in msDS-User-Account-Control-Computed and then check if it is equal to above.
Please let me know how to get value for the number of days before password expires
Nov 03, 2008 02:43 PM|jnsuryaprakash|LINK
I dont know how it can be done through dotnet. But i know how it can be done in vbscript.
I think you can code in VBScript in ASPX page. In that case you can use below code
First get the password last changed date
Set objUser = GetObject("LDAP://CN=myerken,OU=management,DC=fabrikam,DC=com")
dtmValue = objUser.PasswordLastChanged '
and then get the number fo days the password generally expires. Remaining days are < 15 then send notification.
Set objMaxPwdAge = objDomain.Get("maxPwdAge")
Refer to below article