I need to calculate the amount of time a computer was up for per month.
There seem to be various messages to check for different events which shutdown a PC:
Shutdown
- Event ID 41 The system has rebooted without cleanly shutting down first. This error could be caused if the system stopped responding, crashed, or lost power unexpectedly.
- Event ID 1074 Logged when an app (ex: Windows Update) causes the system to restart, or when a user initiates a restart or shutdown.
- Event ID 6006 Logged as a clean shutdown. It gives the message "The Event log service was stopped". 6008 Logged as a dirty shutdown. It gives the message "The previous system shutdown at time on date was unexpected".
- Event ID 1074 (alternate): "The process X has initiated the restart / shutdown of computer on behalf of user Y for the following reason: Z." Indicates that an application or a user initiated a restart or shutdown.
- Event ID 1076 (alternate): "The reason supplied by user X for the last unexpected shutdown of this computer is: Y." Records when the first user with shutdown privileges logs on to the computer after an unexpected restart or shutdown and supplies a reason for the occurrence.
Startup
- Event ID 12: The operating system started at system time
- Event ID 6005 (alternate): “The event log service was started.” This is synonymous to system startup.
- Event ID 6009 (alternate): Indicates the Windows product name, version, build number, service pack number, and operating system type detected at boot time.
- Event ID 6013: Displays the uptime of the computer after last reboot
Is there a single log message I can examine the Windows event log for to catch all of the times a PC has shutdown/restarted?
Does Event ID 12 always get sent regardless of the reason why the shutdown occured?