Submitted by PhilEddies on Tue, 02/02/2010 - 12:18administrator | 4563 points
If you are looking to change the windows default password expiry notification from 14 days to somthing else then this should help.
The default value of 14 days is stored in the DWORD registry key HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\passwordexpirywarning simply changing or creating this key will alter the number of days prior to expiry the user will get notified.
If like me you want to change this for more than one computer then the below vbs script run as part of a logon script etc should do the trick.
Set objShell = CreateObject("WScript.Shell")
regKey = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\passwordexpirywarning"
regValue = 7'Number of days warning in decimal
objShell.RegWrite regKey, regValue, "REG_DWORD"
Unless you change the permissions on the rey key using group policy or some other method then the script will need to be run as an administrator.