Tools / Event IDs / Event ID 4647

Event ID 4647: user-initiated logoff

What Event ID 4647 (user-initiated 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 4647 is written when a user starts the logoff themselves, from the Start menu or with logoff. It only applies to interactive and RDP sessions. Comparing 4647 with 4634 tells you whether the user signed out deliberately.

The fields that matter

FieldWhat it tells you
Subject > Account NameWho logged off.
Logon IDLinks to the 4624 that started the session.

What is normal

Users signing out at the end of a session.

When Event ID 4647 is suspicious

Common false positive: Normal behaviour.

Find Event ID 4647 with PowerShell

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

Related events

FAQ

What is the difference between 4647 and 4634?

4647 says the user asked to log off. 4634 is written when the session actually ends, whatever the reason.