JSI Tip 1276. Produce a report of the last time a user logged on to any domain controller.

contains UsrStat, which will produce a multi-domain-controller report, but each domain controller is listed separately. It still requires substantial manual work to find the last logon. JSIUsrStat.bat uses UsrStat to produce the subject report.

The syntax for using JSIUsrStat.bat is:

JSIUsrStat ReportFile DomainName where:

ReportFile is the full path to the output file.DomainName is your Windows NT domain name.

"%str:~0,20%" set luser=%str%&goto end @echo %luser% >> %file% set luser=%str% goto end :parse set str=%1 set str=%str:"=% set str=%str: - =No Name#% set str=%str: - =# % set str=%str:# logon=#logon% for /f "Tokens=1-2* Delims=#" %%i in ('@echo %str%') do call :parse1 "%%i" "%%j" "%%k" goto end :parse1 set user=%1 set name=%2 set last=%3 set user=%user:"=% # set user=%user:~0,22% set name=%name:"=% # set name=%name:~1,30% set last=%last:"=% set last=%last:~6,25% if /i "%user:~0,9%"

John Savill's Hyper-V Master Class

Join John Savill for 12 hours of comprehensive Hyper-V training. This master-level online training course will explore all the key aspects of a Hyper-V based virtualization environment covering both current capabilities in Windows Server 2012 R2 and looking at the future with Windows Server vNext.