Tools / Event IDs / Event ID 4634

Event ID 4634: logoff

What Event ID 4634 (logoff) means, the fields to check, what is normal and what is suspicious, with PowerShell and KQL queries to find it.

Log: Security · Severity: Informational · Updated 2026-11-03

Event ID 4634 records an account logging off. On its own it tells you little, but paired with the 4624 that has the same Logon ID it gives you the length of a session, which helps size what an attacker could have done with it.

The fields that matter

FieldWhat it tells you
Subject > Account NameWho logged off.
Logon IDMatch this with the 4624 Logon ID.
Logon TypeSame meaning as in 4624.

What is normal

Network logons (type 3) logging off seconds after they start, and interactive sessions ending at the end of the day.

When Event ID 4634 is suspicious

Common false positive: Network logons are short-lived by design and produce huge volumes of 4634.

Find Event ID 4634 with PowerShell

Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4634; 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 == 4634
| project TimeGenerated, Computer, Account, Activity, EventData
| order by TimeGenerated desc

Related events

FAQ

Why is there no 4634 for some logons?

Logoff events are not guaranteed: a crash or power loss leaves none, and some network logons are closed without one.