Event ID 4647: User initiated logoff
Event ID 4647, "User initiated logoff", is written to the Security log when a user starts signing out of an interactive or Remote Desktop session, before Windows tears the session down; it carries the account and the Logon ID of the session being closed.
What event 4647 records
A 4647 means someone (or something acting in the session, such as logoff.exe or shutdown /l) asked Windows to end the session. Microsoft describes it as generated "when a logoff is initiated": at that point no further user activity can happen in the session. The actual destruction of the session follows as 4634, usually within a second or two, but sometimes much later if processes in the session are slow to exit.
The event is short. It names the account (Security ID, Account Name, Account Domain) and the Logon ID. Unlike 4634 it has no Logon Type field, so the type comes from the 4624 with the same Logon ID.
Microsoft notes that 4647 is typical of interactive (type 2) and Remote Desktop (type 10) logons. Network logons to shares, service logons and batch logons end with a 4634 alone, because nobody signs out of them.
4647 vs 4634: which one to trust
| 4647 User initiated logoff | 4634 An account was logged off | |
|---|---|---|
| Means | The user chose to sign out | The session no longer exists |
| Session types | Mostly interactive and Remote Desktop | Almost all, including network and service |
| Logon Type field | No | Yes |
| Timing | The moment sign-out started | When the last process in the session ended; can lag |
| Missing when | The user disconnects, the host crashes or powers off, or the session is reset | The host crashes or powers off; busy servers can coalesce network sessions |
For the question "when did this person stop working on the machine?", 4647 is the better answer, because it records intent and is not delayed by lingering processes. For "how long did this session exist?", pair 4624 with 4634 by Logon ID and fall back to 4647 when the 4634 is missing.
Why closing a Remote Desktop window is not a logoff
Closing the Remote Desktop client, losing the network or choosing Disconnect leaves the session running on the server. Windows writes a disconnect (4779 in Security when "Audit Other Logon/Logoff Events" is on, and event 24 in the Remote Desktop logs), but no 4647 and no 4634. The session keeps its processes, its mapped drives and its credentials in memory until someone signs out, an administrator resets it, or a session time limit ends it.
That difference matters in an investigation. An attacker who closes the window instead of signing out leaves a live session that can be reconnected later (a 4778 and event 25), and leaves the account's credentials in LSASS memory for anyone else who gains administrative access to the host. A 4647 at the end of an attacker's RDP session is, if anything, a sign of someone tidying up.
Reading 4647 in a timeline
- Find the session. Join on Logon ID to the 4624 that opened it. The 4624 gives the logon type, the source address and the time it started.
- Look for activity after the sign-out. Nothing should carry that Logon ID after a 4647. Processes or file access under the same Logon ID afterwards mean the times are wrong, the clock moved, or you have matched the wrong session.
- Check who was still logged on. A 4647 for one user says nothing about other sessions on the same host. On a shared server, list every 4624 type 2 and 10 without a matching end.
- Compare with the RDP logs. On a Remote Desktop host, event 23 ("Session logoff succeeded") in TerminalServices-LocalSessionManager records the same sign-out and often survives longer than the Security log.
Event 4647 fields
The fields an investigator reads first, what they mean, and where Arcsentry stores them.
| Field | Meaning | Arcsentry field |
|---|---|---|
| Subject: Security ID, Account Name, Account Domain | The account that signed out. | user_target_name |
| Logon ID | The session being closed; matches the New Logon ID of its 4624. | event_log_logon_id |
The XML names are TargetUserSid, TargetUserName, TargetDomainName and TargetLogonId, readable in Arcsentry as user_target_name and so on.
What event 4647 proves, and what it does not
It shows
- That the user of this session began signing out at this time.
- With the matching 4624, how long an interactive or RDP session lasted.
It does not show
- That every session of the account ended. Only the session with this Logon ID.
- That a session without a 4647 is still open. Disconnects, crashes and resets never produce one.
- Who was physically at the keyboard. It records the account, not the person.
Attacker activity it reveals
Disconnected sessions left behind
Attackers using stolen credentials over RDP often close the window rather than sign out. The session stays alive and can be reconnected later; look for 4779 or event 24 with no 4647, then a later 4778 or event 25. MITRE ATT&CK T1021.001
Scripted sign-outs
A 4647 seconds after a 4624 type 10, with process creation in between, fits a script or tool that logs on, runs something and logs off, rather than a person working.
Forced logoffs
An attacker can sign out other users (logoff <session id> or rwinsta) to take over a host or release locked files. The 4647 then names the victim, and process creation shows who ran the command.
Finding event 4647 in Arcsentry
Arcsentry parses every channel in Windows\System32\winevt\Logs, whether it comes from an Arcsentry Collector archive, a KAPE or Velociraptor collection, or a disk image. Security log records are the event type evtx_security. In Hunt, with that event type selected:
filter event_code in ("4624", "4647", "4634")
select {timestamp, event_code, user_target_name, event_log_logon_type, event_log_logon_id}
sort {event_log_logon_id, timestamp} Logons, sign-outs and logoffs side by side, grouped by Logon ID so each session reads start to end. Sessions with a 4624 and no 4647 ended some other way (disconnect, reset, crash) or are still open.
Or ask in plain English, for example "show event 4647 on every host, oldest first", and Arcsentry shows the AQL it wrote before it runs. The AQL reference lists the operators used here, and the AI investigator reads the same events, citing each one by its event ID when it reports a finding.
Related event IDs
- Event ID 4634: Logoff
- Event ID 4624: Successful logon
- Event ID 4778: Session reconnected / disconnected
- Event ID 4672: Admin logon (special privileges)
- Event ID 4648: Explicit credentials
All events by investigation question: Windows security event IDs for incident response. Logon types in full: Windows logon types. The log files themselves: Windows event logs.
Frequently asked
What does event ID 4647 mean?
A user started signing out of an interactive or Remote Desktop session. It records the account and the Logon ID of the session. The session itself ends with event 4634.
What is the difference between event ID 4647 and 4634?
4647 records that the user chose to sign out. 4634 records that the session was destroyed, for almost every kind of logon, and includes the logon type. A sign-out usually produces both; network and service logons produce only 4634.
Why is there no 4647 for a Remote Desktop session?
Because the user disconnected rather than signing out. Disconnecting leaves the session running, so Windows writes 4779 (if enabled) and event 24 in the Remote Desktop log, and no logoff until the session is signed out or reset.
Is event 4647 enabled by default?
It belongs to the Audit Logoff subcategory, which logs successes by default on current Windows. Domain Group Policy can turn it off, so check the effective policy with auditpol.
Sources
- Microsoft Learn: 4647(S) User initiated logoff; 4634(S) An account was logged off; Audit Logoff
- MITRE ATT&CK: T1021.001 Remote Desktop Protocol
Checked 2 December 2026 by Venema Labs against Microsoft's audit documentation and, where an example is shown, the named lab case. Field availability varies by Windows version.
Find event 4647 across every host in minutes.
Load your collections, ask what happened, and check every finding against the event behind it. Free for 7 days.
Request a trial