Can't remember where I learned this one, but it's pretty easy to do.
First, decide what you want to name your log file and where you want to save it.
For simplicity's sake, I'll use the the name
usertimes.log and store it in the root of C for this example. (i.e. C:\usertimes.log) Same goes for the two scripts we'll be creating. This is only for illustration purposes. You'll likely want to store this stuff elsewhere - and you'll need to enable sharing on the folder you put them in due to Windows access restrictions.
--------------------------------------------------------------------------------
Important Note: When you create these two scripts, first make a new folder somewhere and share it with your HOMEGROUP. Set share permissions to Read/Write for the group. If you don't, only your account's times will get recorded. You can optionally make this folder a hidden share if you feel it's necessary.
--------------------------------------------------------------------------------
a) Create a folder and share it with your homegroup. Give homegroup read/write access to this folder.
b) Navigate to your new folder, open a text editor, and enter (or copy/paste and edit) this text, and save it as:
login.cmdecho logon %username% %computername% %date% %time% >> C:\usertimes.log
c) Next, do the same with this string and save it as:
logoff.cmdecho logoff %username% %computername% %date% %time% >> C:\usertimes.logYou might have noticed the only difference is that login has been change to logoff in the second script. You may also want to omit %computername% since your users are all logging onto the same PC. (Old sysadmin habits die hard.
)
d) Now you have two scripts which copy login and logoff data to a file called usertimes.log in your C root.
You can use Group Policy to invoke these scripts since Windows has already conveniently included two policy objects for you to do that.
Open the policy editor and navigate to:
User Configuration>Windows Setting>Scripts where you'll find two unconfigured scripts for logon and logoff.
where to find user login logs?Double-click on each script and configure them for the scripts you just created:
where to find user login logs?Voila! Done.
Now all login and logoff times will be appended to the usertimes.log file:
Piece of cake right?