HCHTech
Well-Known Member
- Reaction score
- 4,201
- Location
- Pittsburgh, PA - USA
I got what seemed like a simple request from the controller at one of our clients yesterday: "Can you give me a list of failed & successful logons to my computer over the last couple of weeks? I work mostly remote and I'm concerned someone in the office is walking up to my computer and using it when I'm not connected." Uneducated me: "Sure! It's all there in the event logs, I'll save copies and take a look, then get back to you."
Failed Logons produce event 4625 in the Security log
Successful logons produce event 4624 in the Security log
Easy, right?
Then I get a look at the logs. 25,000 events in the Security log. I sort them by Event ID and get the failed events first - pretty easy. Successful events, not so much. There are thousands. In the text of the event, there is the variable "Logon Type". 9 possible values in this variable, only one of which represents someone logging in at the keyboard, which is type "2". The others are service logons, connecting to shared resources, RDP logons, etc.
There is no way to sort by this detail, sadly. I try exporting the log to a CSV file, but the result still doesn't let me parse the answer I'm looking for. Some log entries are a single row, but many, many of them are multiple rows in the spreadsheet, and the "2" I'm looking for is all by itself in the middle of the several rows that represent the single log entry. No way to sort them all together.
I ended up back in event viewer manually arrowing-down through the thousands of 4624 entries looking for Logon Type 2. 45 minutes and one sore forearm later, I've got the list. I probably should have downloaded one of the paid analyzer software free trials, but I didn't.
So the NEXT time someone asks me this question, I'd like to be a bit better prepared. Does anyone have a better approach at sifting out this data?
Failed Logons produce event 4625 in the Security log
Successful logons produce event 4624 in the Security log
Easy, right?
Then I get a look at the logs. 25,000 events in the Security log. I sort them by Event ID and get the failed events first - pretty easy. Successful events, not so much. There are thousands. In the text of the event, there is the variable "Logon Type". 9 possible values in this variable, only one of which represents someone logging in at the keyboard, which is type "2". The others are service logons, connecting to shared resources, RDP logons, etc.
There is no way to sort by this detail, sadly. I try exporting the log to a CSV file, but the result still doesn't let me parse the answer I'm looking for. Some log entries are a single row, but many, many of them are multiple rows in the spreadsheet, and the "2" I'm looking for is all by itself in the middle of the several rows that represent the single log entry. No way to sort them all together.
I ended up back in event viewer manually arrowing-down through the thousands of 4624 entries looking for Logon Type 2. 45 minutes and one sore forearm later, I've got the list. I probably should have downloaded one of the paid analyzer software free trials, but I didn't.
So the NEXT time someone asks me this question, I'd like to be a bit better prepared. Does anyone have a better approach at sifting out this data?