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.
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
| Field | What it tells you |
|---|---|
| Subject > Account Name | The user. |
| Session Name | RDP-Tcp#N or Console. |
| Client Name / Client Address | The connecting computer. |
| Logon ID | Links 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
- Disconnects from unfamiliar client names or public addresses.
- Short connect and disconnect cycles from one source across many servers.
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
- Event ID 4778: Session reconnected to a window station
- Event ID 4634: Logoff
- Event ID 4647: User-initiated logoff
- RDP Event ID 1149: RDP authentication succeeded
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.
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.