Building a Device Timeline in Microsoft Defender XDR.
One process started.
A file appeared.
A network connection followed.
Agent Foskett put the evidence in order.
Lesson overview
Learn how to build a clear device timeline by correlating Microsoft Defender XDR process, network, file and logon events into one investigation story.
Why device timelines matter
The device timeline workflow
Step 1 — Define the device and timeframe
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
let targetDevice = "WIN-0421";
let startTime = ago(24h);
let endTime = now();
DeviceProcessEvents
| where Timestamp between (startTime .. endTime)
| where DeviceName =~ targetDevice
| project Timestamp,
DeviceName,
AccountName,
FileName,
ProcessCommandLine,
InitiatingProcessFileName
| order by Timestamp asc
Step 2 — Build the process timeline
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
let targetDevice = "WIN-0421";
DeviceProcessEvents
| where Timestamp > ago(24h)
| where DeviceName =~ targetDevice
| project EventType = "Process",
Timestamp,
DeviceName,
AccountName,
FileName,
Detail = ProcessCommandLine,
Parent = InitiatingProcessFileName
| order by Timestamp asc
Step 3 — Add file activity
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
let targetDevice = "WIN-0421";
DeviceFileEvents
| where Timestamp > ago(24h)
| where DeviceName =~ targetDevice
| project EventType = "File",
Timestamp,
DeviceName,
AccountName = InitiatingProcessAccountName,
FileName,
Detail = FolderPath,
Parent = InitiatingProcessFileName
| order by Timestamp asc
Step 4 — Add network activity
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
let targetDevice = "WIN-0421";
DeviceNetworkEvents
| where Timestamp > ago(24h)
| where DeviceName =~ targetDevice
| project EventType = "Network",
Timestamp,
DeviceName,
AccountName = InitiatingProcessAccountName,
FileName = InitiatingProcessFileName,
Detail = strcat(RemoteUrl, " ", RemoteIP),
Parent = InitiatingProcessParentFileName
| order by Timestamp asc
Step 5 — Add logon activity
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
let targetDevice = "WIN-0421";
DeviceLogonEvents
| where Timestamp > ago(24h)
| where DeviceName =~ targetDevice
| project EventType = "Logon",
Timestamp,
DeviceName,
AccountName,
FileName = LogonType,
Detail = ActionType,
Parent = RemoteDeviceName
| order by Timestamp asc
Step 6 — Combine process, file, network and logon events
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
let targetDevice = "WIN-0421";
let startTime = ago(24h);
let processEvents = DeviceProcessEvents
| where Timestamp > startTime
| where DeviceName =~ targetDevice
| project EventType = "Process", Timestamp, DeviceName, AccountName,
Primary = FileName,
Detail = ProcessCommandLine,
Source = InitiatingProcessFileName;
let fileEvents = DeviceFileEvents
| where Timestamp > startTime
| where DeviceName =~ targetDevice
| project EventType = "File", Timestamp, DeviceName,
AccountName = InitiatingProcessAccountName,
Primary = FileName,
Detail = FolderPath,
Source = InitiatingProcessFileName;
let networkEvents = DeviceNetworkEvents
| where Timestamp > startTime
| where DeviceName =~ targetDevice
| project EventType = "Network", Timestamp, DeviceName,
AccountName = InitiatingProcessAccountName,
Primary = InitiatingProcessFileName,
Detail = strcat(RemoteUrl, " ", RemoteIP),
Source = InitiatingProcessParentFileName;
let logonEvents = DeviceLogonEvents
| where Timestamp > startTime
| where DeviceName =~ targetDevice
| project EventType = "Logon", Timestamp, DeviceName, AccountName,
Primary = LogonType,
Detail = ActionType,
Source = RemoteDeviceName;
union processEvents, fileEvents, networkEvents, logonEvents
| order by Timestamp asc
How to read the timeline
Real-world investigation
Investigation checklist
Related Agent Foskett Academy lessons
Coming next
Final thought
Building a Device Timeline in Microsoft Defender XDR
Agent Foskett Academy Lesson 85 teaches defenders how to build a complete device timeline in Microsoft Defender XDR.
Defender XDR device timeline investigation workflow
This lesson explains how DeviceProcessEvents, DeviceNetworkEvents, DeviceFileEvents and DeviceLogonEvents help defenders reconstruct endpoint activity in chronological order during Microsoft Defender XDR investigations.
