Every security incident eventually turns into the same question: what happened, and in what order? When did the attacker first get in? Which account did they use? What did they run, what did they change, and are they still there? On a Windows machine most of the answers are already written down in the event logs. The work is collecting them before they disappear, putting them in a single sequence, and reading that sequence honestly. This is a practical method for doing exactly that.

It assumes you can recognise the core event IDs — 4624, 4625, 4672, 4688, 7045 and friends. If those are new, our Windows Event Viewer guide is the place to start.

Step 1: Preserve before you investigate

Event logs are circular. When a log reaches its maximum size, the oldest entries are overwritten, and on a busy machine the Security log can roll over in days. Investigating on the live system generates new events too. So the very first job is to copy the logs somewhere safe:

:: Run from an elevated command prompt. Use a USB drive or network share, not C:
mkdir E:IRPC01
wevtutil epl Security   E:IRPC01Security.evtx
wevtutil epl System     E:IRPC01System.evtx
wevtutil epl Application E:IRPC01Application.evtx
wevtutil epl Microsoft-Windows-PowerShell/Operational E:IRPC01PowerShell-Operational.evtx
wevtutil epl Microsoft-Windows-TaskScheduler/Operational E:IRPC01TaskScheduler.evtx
wevtutil epl Microsoft-Windows-TerminalServices-LocalSessionManager/Operational E:IRPC01RDP-LSM.evtx
wevtutil epl "Microsoft-Windows-Windows Defender/Operational" E:IRPC01Defender.evtx

Then record a few facts while you are there: the machine’s time zone, whether its clock is in sync, and the current time according to the machine versus a trusted clock. A timeline is only as good as its timestamps, and a clock five minutes off will scramble the order of events across machines.

Check for gaps early. A 1102 in the Security log or a 104 in the System log means a log was cleared — and the event records which account did it. The absence of older events is itself a finding: note when each exported log actually begins.

Step 2: Pick an anchor and a window

You rarely start from nothing. Something triggered the investigation: an antivirus alert, a user report, a strange outbound connection, a ransom note. That is your anchor — a timestamp you trust. Build a window around it, generously: a day or two before (initial access often precedes visible damage by a long way) and everything after, up to the moment you exported the logs.

Write the anchor down with its source. “Defender alert 1116 at 02:14 UTC on PC01” is an anchor; “sometime last night” is not.

Step 3: Know which sources answer which question

Question Log Events to pull
Who logged on, how, and from where? Security 4624, 4625, 4634/4647, 4648, 4672
Remote Desktop sessions TerminalServices-LocalSessionManager/Operational 21 (logon), 24 (disconnect), 25 (reconnect)
What ran? Security; PowerShell/Operational 4688 (if audited); 4104 script blocks
What persisted? System; Security; TaskScheduler/Operational 7045, 4697; 106 (task registered)
Which accounts changed? Security 4720, 4722, 4724, 4732, 4740
Was protection tampered with? Windows Defender/Operational 1116/1117 (detection/action), 5001 (real-time protection disabled)
Reboots and crashes System 6005, 6006, 6008, 41, 1074
Was anything erased? Security; System 1102; 104

Not every machine will have every source. Process-creation auditing (4688) and PowerShell script block logging (4104) are off unless someone turned them on — part of the lesson of every investigation is what you wish you had been logging.

Step 4: Merge everything into one sequence

Each log on its own tells a partial story. The value comes from interleaving them. Get-WinEvent can read the exported .evtx files directly through the Path key, so you can build the timeline on your own workstation rather than the compromised one:

$start = Get-Date '2026-11-01 00:00'
$end   = Get-Date '2026-11-03 12:00'
$dir   = 'E:IRPC01'

$queries = @(
  @{ Path = "$dirSecurity.evtx";   Id = 4624,4625,4648,4672,4688,4697,4720,4732,4740,1102 },
  @{ Path = "$dirSystem.evtx";     Id = 7045,104,6005,6006,6008,41,1074 },
  @{ Path = "$dirPowerShell-Operational.evtx"; Id = 4104 },
  @{ Path = "$dirTaskScheduler.evtx"; Id = 106 },
  @{ Path = "$dirRDP-LSM.evtx";    Id = 21,24,25 },
  @{ Path = "$dirDefender.evtx";   Id = 1116,1117,5001 }
)

$events = foreach ($q in $queries) {
  $q.StartTime = $start; $q.EndTime = $end
  Get-WinEvent -FilterHashtable $q -ErrorAction SilentlyContinue
}

$events | Sort-Object TimeCreated | Select-Object `
  @{ n = 'UTC';     e = { $_.TimeCreated.ToUniversalTime().ToString('yyyy-MM-dd HH:mm:ss') } },
  @{ n = 'Log';     e = { $_.LogName } },
  Id,
  @{ n = 'Summary'; e = { ($_.Message -split "`n")[0].Trim() } } |
  Export-Csv "$dirtimeline.csv" -NoTypeInformation

Two habits make the result trustworthy. Normalise to UTC — especially when you combine machines in different time zones or a period that crosses a daylight-saving change. And keep the source on every row, so any line in your final report can be traced back to the original record.

🔧 BackendSide Tool

DeepDig — Several Files, One Timeline

Exported the logs from the affected machine? Open several .evtx files at once in DeepDig and it analyses them as a single correlated timeline — a corrupt or locked file in the batch is skipped without costing you the rest. Time ranges on an imported file are anchored on that file’s own newest event, so “last 7 days” of a weeks-old export still means its last 7 days. Analysing an exported file needs no admin rights, and nothing leaves your PC.

Explore DeepDig →

Step 5: Follow the session, not just the clock

A sorted list of a few thousand events is still a haystack. The needle-finder is the Logon ID. When an account logs on, the 4624 event records a TargetLogonId. Events performed during that session — the 4672 privilege assignment, the 4688 processes, a 4720 account creation — carry the same value as their SubjectLogonId, and the 4634 logoff closes it. Filter on one Logon ID and a single attacker session falls out of the noise.

# Everything done in one logon session (Logon ID taken from the suspicious 4624)
$logonId = '0x3e7a91c'
Get-WinEvent -FilterHashtable @{ Path = 'E:IRPC01Security.evtx' } |
  Where-Object { $_.ToXml() -match "LogonId`">$logonId<" } |
  Sort-Object TimeCreated |
  Select-Object TimeCreated, Id, @{ n = 'Summary'; e = { ($_.Message -split "`n")[0] } }

A worked example

Here is what a reconstructed timeline might look like for an illustrative case: a small-office PC with Remote Desktop exposed to the internet. The entries are typical of this kind of intrusion, not taken from a real one.

UTC Source Event Reading
Nov 1, 21:02–23:40 Security 4625 ~3,000 failures, type 3, one external address, many user names Password guessing over RDP (NLA records failures as type 3)
Nov 1, 23:41 Security 4624 Success, user reception, type 10, same address Initial access — a weak password finally hit
Nov 1, 23:41 RDP-LSM 21 Session logon for reception Confirms an interactive RDP session
Nov 1, 23:47 Security 4688 powershell.exe launched by explorer.exe Hands-on-keyboard activity
Nov 1, 23:52 Security 4720, 4732 Account support01 created, added to Administrators Persistence via a backup admin account
Nov 1, 23:58 Defender 5001 Real-time protection disabled Defense evasion before the payload
Nov 2, 00:03 System 7045 Service installed, image path in C:UsersPublic Payload installed as a service
Nov 2, 00:09 Security 1102 Audit log cleared by support01 Cover-up — but the earlier export, or another machine, may still hold the history

Read top to bottom, that is a complete story: how they got in, what they did, how they planned to come back, and what they tried to hide. Each line also tells you what to fix — close RDP to the internet, enforce a lockout policy, remove the rogue account and service, re-enable protection, and reset the compromised password.

Notice how much depends on the logs surviving. The 1102 at the end is why Step 1 comes first, and why forwarding logs to another machine is worth the effort long before you need it.

🔧 BackendSide Tool

DeepDig — The Story, Not Just the Rows

A merged CSV is a start; a narrative is the goal. DeepDig correlates related alerts into incidents with a plain-English story, severity, recommended actions and a MITRE ATT&CK mapping. Built-in charts show activity over time — click any bar to drill into the underlying events — the last-reboot card shows whether the last restart was planned or unexpected, and findings export to CSV or JSON for your report.

Explore DeepDig →

Step 6: Write it up while it is fresh

A good incident timeline is short. For each entry: the UTC time, the source log and event ID, what it shows in one sentence, and your confidence. Separate facts (“4720 at 23:52 created support01”) from inferences (“the attacker likely created a backup account”). Note the gaps — missing logs, unaudited categories, cleared periods — because an honest “we cannot see this” is more useful than a confident guess. If you want a refresher on why Windows keeps this record in the first place, There’s a Black Box in Your PC covers the background.

Key takeaways

  • Export the logs first with wevtutil epl; logs are circular and investigating on the live machine adds noise.
  • Start from a trusted anchor and use a generous window — initial access often comes long before visible damage.
  • Pull from several sources: Security, System, PowerShell, Task Scheduler, Remote Desktop and Defender each answer a different question.
  • Normalise to UTC and keep the source on every row so your report can be traced back to the records.
  • Follow the Logon ID to isolate a single session from thousands of events.
  • Treat 1102 and 104 as findings, and record what you could not see. DeepDig can merge several exported logs into one correlated timeline and tell the story in plain English.