Windows restart and shutdown history with event IDs
System log event IDs to reconstruct Windows startups, shutdowns and restarts.
Startup, shutdown and user logon/logoff events on a Windows machine are recorded in the System log. The event IDs below let you reconstruct the restart history.
Startup and shutdown events
| ID | Meaning |
|---|---|
| 6005 | The Event Log service started: indicates system startup |
| 6006 | The Event Log service stopped: indicates system shutdown |
| 6008 | The previous system shutdown was unexpected |
| 6009 | Windows product name, build number and OS type detected at boot |
| 6013 | Uptime of the computer |
| 1074 | A process or a user initiated a restart or shutdown, with the reason given (often triggered by Windows Update) |
| 1076 | Reason supplied by the user for the last unexpected shutdown, recorded when the first user with shutdown rights logs on afterwards |
| 7001 / 7002 | User logon and logoff (Winlogon) |
Check the uptime
In a command prompt (cmd.exe):
systeminfo | find "System Up Time"
On recent Windows versions, the line is called "System Boot Time":
systeminfo | find "System Boot Time"
Query the event log
Get-WinEvent -LogName System | Where-Object {$_.Id -eq 1074 -or $_.Id -eq 6006 -or $_.Id -eq 6008 -or $_.Id -eq 6009} | Select-Object -First 10
Notes
- Events 6005 and 6006 mark the start and stop of the Event Log service, which coincide with system startup and shutdown.
- Event 1074 is written when a restart or shutdown is requested, so it is useful to identify the origin of a planned restart.