Tracking Server Logins

It’s nice to know who and when people are logging on to your servers, here is a very simple way of recording someone logging on and logging off the server

Create a file called:

logon.cmd

echo logon %username% %computername% %date% %time% >> “C:\logon.log”

logoff.cmd

echo logoff %username% %computername% %date% %time% >> “C:\logon.log”

Update ther Group Policy, via gpedit.msc  

User Configuration-> Windows Settings-> Scripts (Logon/Logoff)-> Logon
User Configuration-> Windows Settings-> Scripts (Logon/Logoff)-> Logoff

 

When the users log on and off a log file will be updated