account expiry warning

C

Cathy

just a quick question..

ive' set all users account in my domain to expire in 6
months.. im just wondering if users will be receiving a
warning days before the expiration date of their account..
just like the warning they're receiving 14 days before
their password expires..

i can't seem to find an article on microsoft or in google
mentioning abt a warning msg for account expiry...

is there a way i can set it on my AD?

thanks for all the help!
 
J

Jerold Schulman

just a quick question..

ive' set all users account in my domain to expire in 6
months.. im just wondering if users will be receiving a
warning days before the expiration date of their account..
just like the warning they're receiving 14 days before
their password expires..

i can't seem to find an article on microsoft or in google
mentioning abt a warning msg for account expiry...

is there a way i can set it on my AD?

thanks for all the help!


I don't believe there will be a warning.

You can create one, use blat (tip 4721 in the 'Tips & Tricks' at
http://www.jsiinc.com, and UnivDate, tip 4835, and GetUsers, tip 7964, and
datemath, tip 721:

@echo off
setlocal
set /a warn=14
if not {%1}=={} set /a warn=%1
call univdate
call jsidatem %yy% %mm% %dd% + %warn%
@echo %AYMD%
for /f "Tokens=*" %%u in ('getusers') do (
set user=%%u
call :chkdt
)
if exist "%TEMP%\aewarn.txt" del /q "%TEMP%\aewarn.txt"
endlocal
goto :EOF
:chkdt
for /f "Tokens=3" %%a in ('net user "%user%" /domain^|findstr /i /L /c:"Account
expires"') do (
REM The above 2 lines are 1 line
set expires=%%a
)
if /i "%expires%" EQU "Never" goto :EOF
for /f "Tokens=1-3 Delims=/" %%m in ('@echo %expires%') do (
set mm=%%m
set dd=%%n
set yy=%%o
)
set /a yy=10000%yy%%%10000
set /a mm=100%mm%%%100
set /a dd=100%dd%%%100
if %yy% LSS 10 set yy=200%yy%
if %yy% LSS 100 set yy=20%yy%
if %mm% LSS 10 set mm=0%mm%
if %dd% LSS 10 set dd=0%dd%
if "%AYMD%" LSS "%yy%%mm%%dd%" goto :EOF
@echo %user%: Your account expires on %expires%.>"%TEMP%\aewarn.txt"
blat "%TEMP%\aewarn.txt" -to %user%@%UserDNSDomain% -s "%user%: Your account
expires on %expires%"
REM The above 2 lines are 1 line


Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top