Tools / Event IDs / Event ID 4779

Event ID 4779: session disconnected from a window station

What Event ID 4779 (session disconnected from a window station) means, the fields to check, what is normal and what is suspicious, with PowerShell and KQL queries to find it.

Log: Security · Severity: Informational · MITRE ATT&CK T1021.001 · Updated 2026-11-03

Event ID 4779 marks a session being disconnected without logging off: an RDP window closed, a network drop or an idle timeout. With 4778 it brackets when a remote user was actually connected.

The fields that matter

FieldWhat it tells you
Subject > Account NameThe user.
Session NameRDP-Tcp#N or Console.
Client Name / Client AddressThe connecting computer.
Logon IDLinks the session together.

What is normal

Users closing RDP windows instead of signing out, which leaves sessions running on servers.

When Event ID 4779 is suspicious

Common false positive: Unstable networks produce many 4779 and 4778 pairs for the same user.

Find Event ID 4779 with PowerShell

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

Related events

FAQ

Is a disconnected session still logged on?

Yes. Processes keep running and credentials stay in memory until logoff (4634 / 4647), which is why disconnected admin sessions on servers are a risk.