Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
April 20, 1999
If your Account Policy (User Manager / Policies / Account) is Allow Changes in n Days, you may want a report of user accounts that are temporarily prohibited from changing their password.
On your PDC run:
JSIPNChg folderPNChg.txt
where folderPNChg.txt is the output report file.
JSIPNChg.bat uses only standard commands and contains:
@echo offif NOT "%1"
"The command completed successfully." goto endset substr=%str:~0,25%#set substr=%substr: =%set substr=%substr: #=%set substr=%substr:#=%if "%substr%"
"" goto endset /a cnt=0for /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%"
"The command completed successfully." goto endset ustr=%ustr:"=%if %cnt% EQU 2 set fullname=%ustr:~29,99% & set actv="Y"if %cnt% EQU 6 goto activeif %cnt% EQU 8 goto lastsetif %cnt% EQU 10 goto changeif %cnt% NEQ 12 goto endset ls="%ustr:~29,3%"if %actv%
"Yes" goto endif "%change%"
"Yes" goto endset actv="N"goto end:lastsetset last="%ustr:~29,16%"goto end:nochgset change=Ngoto end:changeset change=%ustr:~29,16%if "%change%" LEQ %last% goto nochgfor /f "Tokens=1-4 Delims=/ " %%i in ('@echo %change%') do set mm=%%i&set dd=%%j&set yy=%%k&set tt=%%lset /a year=%yy%if %year% LEQ 80 set /a year=%year% + 2000if %year% LEQ 99 set /a year=%year% + 1900set chg=%year%%mm%%dd%%tt%if "%chg%" LEQ "%now%" set change=N:end
You May Also Like