To generate a report of accounts that will expire, run (on your PDC):

JSIWExpire <Drive:>\Folder\WExpire.txt

where <Drive:>\Folder\WExpire.txt is the output report file.

JSIWExpire.bat uses only standard commands and contains:

@echo off                              if NOT "%1"

"" goto begin :syntax @echo Syntax: JSIWExpire File goto end :begin setlocal set file=%1 if exist %file% del /q %file% for /f "Skip=4 Tokens=*" %%i in ('net users') do call :parse "%%i" endlocal goto end :parse set str=#%1# set str=%str:#"=% set str=%str:"#=% if "%str%"

"The command completed successfully." goto end set substr=%str:~0,25%# set substr=%substr: =% set substr=%substr: #=% set substr=%substr:#=% if "%substr%"

"" goto end set /a cnt=0 for /f "Tokens=*" %%i in ('net user "%substr%"') do call :parse1 "%%i" set substr=%str:~25,25%# set substr=%substr: =% set substr=%substr: #=% set substr=%substr:#=% if "%substr%"

"" goto end set /a cnt=0 for /f "Tokens=*" %%i in ('net user "%substr%"') do call :parse1 "%%i" set substr=%str:~50,25%# set substr=%substr: =% set substr=%substr: #=% set substr=%substr:#=% if "%substr%"

"" goto end set /a cnt=0 for /f "Tokens=*" %%i in ('net user "%substr%"') do call :parse1 "%%i" goto end :parse1 set /a cnt=%cnt% + 1 set ustr=%1 if %ustr%

"The command completed successfully." goto end set ustr=%ustr:"=% if %cnt% EQU 2 set fullname=%ustr:~29,99% &set active=n if %cnt% EQU 7 goto tsta if %cnt% NEQ 6 goto end set ls="%ustr:~29,3%" if /i not %ls%

"Yes" goto end set active=y goto end :tsta if not "%active%"

"y" goto end set ls="%ustr:~29,5%" if /i %ls%=="Never" goto end set Expires="%ustr:~29,17%" set substr=%substr:"=% set substr=%substr% # set substr=%substr:~0,22% set fullname=%fullname:"=% set fullname=%fullname% # set fullname=%fullname:~0,30% set Expires=%Expires:"=% set Expires=%Expires% # set Expires=%Expires:~0,17% @echo %substr% %Expires% %fullname% >> %file% :end