Event ID 4801: workstation unlocked
What Event ID 4801 (workstation unlocked) means, the fields to check, what is normal and what is suspicious, with PowerShell and KQL queries to find it.
Event ID 4801 records the workstation being unlocked, the counterpart of 4800. Together they show when a person was at the keyboard.
The fields that matter
| Field | What it tells you |
|---|---|
| Subject > Account Name | The user who unlocked. |
| Session ID | The session. |
What is normal
Unlocks during working hours by the usual user.
When Event ID 4801 is suspicious
- Unlocks in the middle of the night on a machine whose user is known to be away.
- Unlocks shortly after many failed unlock attempts (4625 with logon type 7).
Common false positive: Normal daily use.
Find Event ID 4801 with PowerShell
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4801; 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 == 4801
| project TimeGenerated, Computer, Account, Activity, EventData
| order by TimeGenerated desc
Related events
- Event ID 4800: Workstation locked
- Event ID 4625: Failed logon
- Event ID 4624: Successful logon
FAQ
Does unlocking log a 4624?
Yes, a 4624 with logon type 7 is also written for the unlock.
Have an export full of these events?
Open Event Triage
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.
Found an IP, domain or hash in the event?
Add IOC Triage to Chrome
IOC Triage, our free browser extension: right-click it for a verdict from 15 threat-intel sources, then copy a ready ticket note.