Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×
  • entries
    14
  • comments
    21
  • views
    282

Script to Record Computer Usage


Hi,

 

Just thought these scripts would be handy. It will dump logon details to a text file.

 

You will need to create a share with a folder called Computers & one called users. Your users will need permissions to write to the folder.

 

These are the 2 script. You will need to make one a log on script and one a log off. You will need to modify the location of your share. They are both .bat format

 

Logon Script

 

rem The following line creates a rolling log file of usage by workstation
echo Log In %Date% %TIME% %USERNAME% >> \\server\share\Computers\%COMPUTERNAME%.log

rem The following line creates a rolling log file of usage by user
echo Log In %Date% %TIME% %COMPUTERNAME% >> \\server\share\users\%USERNAME%.log

 

Log Off Script

 

rem The following line creates a rolling log file of usage by workstation
echo Log Off %Date% %TIME% %USERNAME% >> \\server\share\Computers\%COMPUTERNAME%.log

rem The following line creates a rolling log file of usage by user
echo Log Off %Date% %TIME% %COMPUTERNAME% >> \\server\share\users\%USERNAME%.log

1 Comment


Recommended Comments

browolf

Posted

mine is similar to that but we don't bother with log-off script.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...