Audit log of what time users log on to their computer in a certain office using Windows 2008 Active Directory/Group Policy

I’ve been asked if it’s possible to create a log of what time users log on to their computer in a certain office within the company.

All users in that department are in their own OU.

Is there the ability to audit log this within AD/Group Policy on a domain ?

I'll need to easily provide the log weekly to the head of that department.

Not sure of the HR implications on this or what happens if a user just locks their computer on an evening when they go home. Will that have an effect on logging in the next day ?

Anyway, it’s just a question at the moment so need to know if and how this can be done if possible.

Thank you for your time.
rookeydooksAsked:
Who is Participating?
 
XaelianCommented:
Hi,

You can create log-in and logoff script for it.

       
Set up a Share on the network.

The batch file is actually two files. One runs at user log on and one runs at user log off. When the batch files run, they create a rolling log file with the details in a shared network folder.

1) Create a shared folder on the network. Mine is called Logs$ (so it's invisible for the users when they access the computer through the network). Everyone should have read/write access to this share.
2) In that folder, create a folder called User and a folder called Computer.
            
Create the batch files.

Copy and Paste the following into two separate text files. When you save them, remember to change the file type to .bat

Name: Log On.bat

rem The following line creates a rolling log file of usage by workstation
echo Log In %Date% %TIME% %USERNAME% >> \\servername\Logs$\Computer\%COMPUTERNAME%.log

rem The following line creates a rolling log file of usage by user
echo Log In %Date% %TIME% %COMPUTERNAME% >> \\servername\Logs$\User\%USERNAME%.log

Name: Log Off.bat

rem The following line creates a rolling log file of usage by workstation
echo Log Off %Date% %TIME% %USERNAME% >> \\servername\Logs$\Computer\%COMPUTERNAME%.log

rem The following line creates a rolling log file of usage by user
echo Log Off %Date% %TIME% %COMPUTERNAME% >> \\servername\Logs$\User\%USERNAME%.log

Put these files in the Logs folder.

      
Add the batch files to group policy.

You do this on your User Container GPO.

User Configuration > Windows Settings > Scripts

Add Log In.bat to the Logon scripts box and Log Off.bat to the Logoff scripts box.
0
 
rookeydooksAuthor Commented:
Perfect.. Works a treat !

Thank you so much for your help Xaelian. Very clear instructions.
0
 
rookeydooksAuthor Commented:
Exactly what i was looking for and explained in very easy to follow steps.

Thank you so much Xaelian.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.