Event ID 4634: An account was logged off
Event ID 4634, "An account was logged off", is written to the Security log when a logon session on a Windows computer is destroyed, and carries the same Logon ID as the 4624 that started it.
What event 4634 records
A 4634 marks the moment Windows tore down a logon session: the last process in it ended, the network connection closed, or the user signed out. It is short: the account, its Logon ID and the logon type. Its value is almost entirely in the Logon ID, which pairs it with the 4624 that opened the same session.
Pairing the two gives the length of a session, which matters when the question is "how long was the attacker on this box?" or "was this account still logged on when the files were copied?".
4634 and 4647: two kinds of logoff
| Event | Written when | Reliability |
|---|---|---|
| 4647 User initiated logoff | A user chooses Sign out in an interactive or RDP session | Only for interactive sessions, and only when the user signs out |
| 4634 An account was logged off | The session is actually destroyed | Written for most session types, but can be delayed or missing |
An interactive sign-out usually produces a 4647 followed by a 4634. A network (type 3) logon to a file share produces a 4634 when the connection is closed, which can be seconds or hours after the access. A Remote Desktop session that is disconnected rather than signed out stays alive, so no logoff is written until it is reset or the user signs out; the disconnect itself is in the TerminalServices-LocalSessionManager log (event 24) and in Security as 4779.
Why 4634 is often missing
Sessions that end with a crash, a power-off or a reboot never get a clean logoff. Busy servers coalesce network logons, so the 4634 may not line up with any one access. And because logoff auditing produces a lot of volume, some organisations turn it off. Treat a missing 4634 as "unknown end", never as "still logged on".
Session ends in a timeline
When a session has no logoff, the last event carrying its Logon ID (a process start, a file access, a privilege use) is the latest time it is known to have been active. That is the honest end of the session in a report: "active until at least 22:14", not "logged off at 22:14". Arcsentry's session rebuild follows the same rule and shows a session without a recorded end as open-ended rather than inventing one.
Event 4634 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 whose session ended. | user_target_name |
| Logon ID | Matches the New Logon ID in the 4624 that began the session. | event_log_logon_id |
| Logon Type | The type of the session that ended. | event_log_logon_type |
What event 4634 proves, and what it does not
It shows
- That the session with this Logon ID ended at or before this time.
- With the matching 4624, the session's duration.
It does not show
- That the user chose to log off (that is 4647).
- That a session without a 4634 is still open.
- When a network session's activity actually stopped; the logoff can lag well behind the last access.
Attacker activity it reveals
Short, repeated network sessions
Many type 3 logon and logoff pairs a few seconds apart from one source are typical of remote execution and scanning tools that connect, run one command and disconnect. MITRE ATT&CK T1021.002
Session length in a timeline
An RDP session by a compromised account that lasted 40 minutes bounds the window in which its commands, file access and downloads happened. Pair 4624 type 10 with 4647 or 4634, or use the RDP session events 21 to 24.
Finding event 4634 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", "4634", "4647")
select {timestamp, event_code, user_target_name, event_log_logon_type, event_log_logon_id}
sort {event_log_logon_id, timestamp} Logons and logoffs side by side, ordered by Logon ID so each session's start and end sit together. In practice you rarely need this: Arcsentry pairs these events (and the Remote Desktop ones) into sessions automatically, with a start, an end where one exists and a duration, in the sessions view.
Or ask in plain English, for example "show event 4634 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 4624: Successful logon
- Event ID 4647: User initiated logoff
- Event ID 4778: Session reconnected / disconnected
- Event ID 4779: Session disconnected
- Event ID 24: RDP session disconnected
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 is the difference between event ID 4634 and 4647?
4647 is written when a user chooses to sign out of an interactive or RDP session. 4634 is written when the logon session is actually destroyed, for most logon types. A sign-out usually produces both, 4647 first.
Why is there no 4634 for a logon?
The session may still be open, may have ended in a crash or reboot, may be a disconnected RDP session that was never signed out, or logoff auditing may be off. A missing 4634 means the end is unknown.
How do I calculate session duration from the Security log?
Match the Logon ID in the 4624 with the Logon ID in the later 4634 (or 4647) on the same computer. The difference in time is the session length. For RDP, the LocalSessionManager events 21, 23, 24 and 25 give connect, disconnect and reconnect times too.
Sources
- Microsoft Learn: 4634(S) An account was logged off
- Microsoft Learn: 4647(S) User initiated logoff
Checked 1 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 4634 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