In tip 531, we created JSIToday to parse today's date and JSIExpDT to parse a user's password expiration date.
You can configure when Windows NT issues a password expiration warning by using tip 141.
In tip 721, we built JSIDateM, a generalized date math routine.If you want to issue your own password expiration warning, you need the ability to do DATE math. Create JSIExpire.bat:
Usage: JSIExpire "UserName" Days <Path>\notify.bat
@echo The password for account %1 expires on %NYY%-%NMM%-%NDD% which is within %2 days of %TDYY%-%TDMM%-%TDDD% (Today minus %2 is %XYMD%) REM You can use any form of notification that you wish: REM Net Send %1 Your password expires on the day %NDD% of month %NMM% in year %NYY%. Please change it today. REM or use a freeware command line mailer like Blat.JSIExpire also returns a PWDX evironment variable with the following values:
N=Does not expire within Days days.
Y=Does expire within Days days.