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 ×

Recommended Posts

Posted

I have written a script which runs at user logon and logoff:

 

@echo off

color F0

net use L: \\yourservername\dir /U:username password

echo **User Logon** UserName: %USERNAME% ComputerName:%COMPUTERNAME% UserDomain:%USERDOMAIN% UserProfile:%USERPROFILE% System Time: %TIME% System Date: %DATE% Currently Attached to Server: %LOGONSERVER% >>L:\Logon.txt

net use L: /del /yes

timeout 3

 

It works very well and we now have a log file which logs all of our users logging onto machines and shows them logging off also with times and dates.

 

Primarily I hadn't made the script to map a network drive but I kept getting "Acess Denied" So it now maps to a drive creates the log and then the script disconnects the map drive and its like it never existed, but if you go to your server and look in the folder where the drive is mapped too you should see a log file.

 

Obviously you can customize the script to your needs.

 

I hope this helps you!

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...