Logged in Logs

Over the years I’ve been asked at different times to audit the login habits of different people. Recently we set up a script that does this for our RDS host, reporting to a webpage, and on a personal project we set it up for a guy to prove to his boss that he is indeed arriving and leaving when he says he is.

I’ve see alot of bad information about what logs to collect – so thought I would clarify exactly what gives you a gold standard from your logs. The real gold standard comes from collecting them from the local machine in question, and this is true for desktops and servers alike.

Gold Standard

You don’t need all of these to get a clean view, but it would be neglegant of me not give everything, and still call it gold.

Application and Services Logs: Microsoft-Windows-TerminalServices-LocalSessionManager/Operational

  • Event ID: 21 – Session Logon Succeeded
  • Event ID: 22 – Desktop loaded
  • Event ID: 23 – Session Logoff
  • Event ID: 24 – Session Disconnected
  • Event ID: 25 – Session Reconnected

Windows logs: Security (you need permissions to access these logs)

  • Event ID: 4624 – Type 7 (User unlock from Keyboard e.g. locally)
  • Event ID: 4647 – User Initiated Log Off
  • Event ID: 4800 – Workstation Locked
  • Event ID: 4801 – Workstation Unlocked

Note: 4800 & 4801 need to be enabled through group policy, they aren’t logged by default.

Windows logs: System

  • EventID: 1074 – User Shutdown – This is where you will see an Update reboot by SYSTEM
  • EventID: 41 – Bad Restart
  • EventID: 6006 – Clean Shutdown
  • EventID: 6008 – Bad Shutdown
  • EventID: 6009 – OS and processor info written

Note: 6009 Is a simple and clear cut way to tell that a computer has powered on. I could have called it that above, but then someone would look it up, and complain that it really stands for the OS and processor info written at boot.

With these logs you can paint a picture of people turning a PC on or off, logins, locking, unlocking – and if you have if you like graphs the way I do, you could monitor the RDS hosts and paint a picture of usage vs abandoment, for those people who just minimise or disconnect from the session and eat up resources of those trying to work.

Leave A Comment

Your email address will not be published. Required fields are marked *