Event ID 4800: workstation locked
What Event ID 4800 (workstation locked) means, the fields to check, what is normal and what is suspicious, with PowerShell and KQL queries to find it.
Event ID 4800 records the workstation being locked. It isn't a security alert, but in an investigation it helps show when the user was at the machine and when they weren't, which matters when something ran while the screen was locked.
The fields that matter
| Field | What it tells you |
|---|---|
| Subject > Account Name | The user. |
| Session ID | The session that was locked. |
What is normal
Users locking their screen during the day, and automatic locks after inactivity.
When Event ID 4800 is suspicious
- Interactive activity, such as processes started by the user, while the workstation was locked.
- Remote logons to the machine in the gap between 4800 and 4801.
Common false positive: Screen locks from inactivity are entirely normal; use 4800 only for timelines.
Find Event ID 4800 with PowerShell
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4800; StartTime=(Get-Date).AddDays(-7)} -MaxEvents 50 |
ForEach-Object {
$d = [ordered]@{ Time = $_.TimeCreated; Computer = $_.MachineName }
([xml]$_.ToXml()).Event.EventData.Data | ForEach-Object { $d[$_.Name] = $_.'#text' }
[pscustomobject]$d
} | Format-List
Microsoft Sentinel (KQL)
SecurityEvent
| where TimeGenerated > ago(7d) and EventID == 4800
| project TimeGenerated, Computer, Account, Activity, EventData
| order by TimeGenerated desc
Related events
- Event ID 4801: Workstation unlocked
- Event ID 4624: Successful logon
- Event ID 4634: Logoff
FAQ
Which audit setting logs 4800?
Audit Other Logon/Logoff Events, which is off by default.
Windows Event Triage reads a CSV, EVTX-to-JSON or XML export in your browser and flags brute force, new admins, suspicious services and log clearing.
IOC Triage, our free browser extension: right-click it for a verdict from 15 threat-intel sources, then copy a ready ticket note.