No announcement yet.

Use AD script to record log on and log off times

  • Filter
  • Time
  • Show
Clear All
new posts

  • Use AD script to record log on and log off times

    I am looking for a sample or an actual log in script and log off script to use in AD to record when a user logs in and then logs out (when they boot up a computer and then shutdown a computer). Anything from creating a TEXT file for each event into a folder on the server or anything ellaborate.

    Also, I am also interested in if there is a way to record it when they just log out ( not shut down). I have many managers that are asking if I have a way to indicate when a person shutdown.


  • #2
    I don't know of anyway's to log when a computer is shutdown but the logon\logoff times are simple to do.

    This information can be gathered from the security logs though !!!

    But if you want text files then you can simply add

    ECHO User Logged (off\on) @ %TIME% %DATE% >> \\server\share\%username%.txt

    To your login\logoff script (if you run a batch file). Then you'll just end up with a share full of text files with usernames, each containing their logon times.

    Note that the users will need write access to this share to do this though !!!

    Hope this helps

    * Shamelessly mentioning "Don't forget to add reputation!"