- Description of the Shutdown Event Tracker
- Summary
- More information
- Custom Options for identifying a shutdown cause
- Описание отслеживания событий завершения работы
- Аннотация
- Дополнительные сведения
- Настраиваемые параметры для определения причины завершения работы
- Windows: Shutdown/Reboot Event IDs – Get Logs
- Shutdown Event IDs
- Display Shutdown Logs in Event Viewer
- Find Shutdown Logs using PowerShell
- Windows Server restart / shutdown history
- 6 Answers 6
Description of the Shutdown Event Tracker
This article describes the Shutdown Event Tracker.
Original product version: В Windows 10 — all editions, Windows Server 2012 R2
Original KB number: В 293814
Summary
Shutdown Event Tracker is a Microsoft Windows Server 2003 and Microsoft Windows XP feature that you can use to consistently track the reason for system shutdowns. You can then use this information to analyze shutdowns and to develop a more comprehensive understanding of your system environment. Shutdown Event Tracker logs events that are similar to the following in the system event log:
More information
Windows Server 2003 and Windows XP 64-Bit Edition Version 2003
By default, Shutdown Event Tracker is enabled for all Windows Server 2003 operating systems and for Windows XP 64-Bit Edition Version 2003.
To disable Shutdown Event Tracker on all Windows Server 2003 operating systems and in Windows XP 64-Bit Edition Version 2003, disable the Display Shutdown Event Tracker policy by using Group Policy. To do it by using Local Group Policy, follow these steps:
- Select Start, and then select Run.
- Type gpedit.msc, and then select OK.
- Expand Computer Configuration, expand Administrative Templates, and then expand System.
- Double-click Display Shutdown Event Tracker.
- Select Disabled, and then select OK.
Windows XP Professional
By default, Shutdown Event Tracker is disabled in Windows XP Professional.
To enable Shutdown Event Tracker in Windows XP Professional, in Windows XP Tablet PC Edition, and in Windows XP Media Center Edition, enable the Display Shutdown Event Tracker policy by using Group Policy. To do it by using Local Group Policy, follow these steps:
- Select Start, and then select Run.
- Type gpedit.msc, and then select OK.
- Expand Computer Configuration, expand Administrative Templates, and then expand System.
- Double-click Display Shutdown Event Tracker.
- Select Enabled.
- In the Shutdown Event Tracker should be displayed box, select Always, and then select OK.
Shutdown Event Tracker isn’t a functional component in Windows XP Home Edition. So you can’t use Shutdown Event Tracker in Windows XP Home Edition.
Microsoft recommends that you don’t enable the Shutdown Event Tracker in Windows XP Professional, Windows XP Tablet PC, or Windows XP Media Center Editions. Microsoft doesn’t support the use of this component in these Windows XP environments.
Custom Options for identifying a shutdown cause
This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information, see How to back up and restore the registry in Windows.
Windows provides a list of eight generic reasons why your computer was shut down. You can modify this list to include your own custom reasons. To add your own reasons, follow these steps:
Start Registry Editor.
Locate and then select the following registry key: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Reliability\UserDefined
On the Edit menu, select New, and then select Multi-String Value. Which creates the new key and gives it the temporary name «New Value.»
Type the name of the registry key in the following format, and then press ENTER: UI_control_flags; major_reason_number; minor_reason_number
The UI_control_flags section of the value name can contain one or more of the following values:
- P (Indicates that the reason is planned. If this value is omitted, the default is unplanned.)
- C or B (Indicates that a comment is required.)
- S (Indicates that the reason should be displayed in the user-initiated shutdown dialog box.)
- D (Indicates that the reason should be displayed in the sudden shutdown dialog box.)For example, if you want a reason to be displayed in the sudden shutdown dialog box, the shutdown is unplanned, and the shutdown corresponds to a major reason 2 and to a minor reason 2, type the following value name: D;2;2
Double-click the new key, and then define the value data in the following format:
Each value is made up of two strings on separate lines; the first string is the title (it’s displayed in the list) and the second string is the description (it’s the text that is displayed following the selected reason).
For example, if you want to create a custom reason for a natural disaster, you can define the value data as follows: Natural Disaster (unplanned)
A flood, an earthquake, a tornado, or another unplanned natural event requires that the computer shuts down. Specify the natural event in the comment area.
Описание отслеживания событий завершения работы
В этой статье описывается отслеживание событий завершения работы.
Исходная версия продукта: Windows 10 — все выпуски, Windows Server 2012 R2
Исходный номер КБ: 293814
Аннотация
Отслеживание событий завершения работы — это функция Microsoft Windows Server 2003 и Microsoft Windows XP, которую можно использовать для согласованного отслеживания причины отключения системы. Затем эти сведения можно использовать для анализа завершения работы и разработки более полного понимания системной среды. Отслеживание событий завершения работы занося в журнал событий, аналогичных следующим событиям системы:
Дополнительные сведения
Windows Server 2003 и Windows XP 64-Bit Edition версии 2003
По умолчанию отслеживание событий завершения работы включено для всех операционных систем Windows Server 2003 и Windows XP 64-Bit Edition версии 2003.
Чтобы отключить отслеживание событий завершения работы во всех операционных системах Windows Server 2003 и Windows XP 64-Bit Edition версии 2003, отключать политику отслеживания событий завершения работы с помощью групповой политики. Чтобы сделать это с помощью локальной групповой политики, выполните следующие действия:
- Нажмите кнопку Пуск и выберите пункт Выполнить.
- Введите gpedit.msc и выберите «ОК».
- Раз развернуть конфигурацию компьютера, развернуть административные шаблоны, а затем развернуть «Система».
- Дважды щелкните display Shutdown Event Tracker.
- Выберите «Отключено» и «ОК»
Windows XP Professional
По умолчанию в Windows XP Professional отключено отслеживание событий завершения работы.
Чтобы включить отслеживание событий завершения работы в Windows XP Professional, Windows XP Tablet PC Edition и Windows XP Media Center Edition, включите политику отслеживания событий завершения работы с помощью групповой политики. Чтобы сделать это с помощью локальной групповой политики, выполните следующие действия:
- Нажмите кнопку Пуск и выберите пункт Выполнить.
- Введите gpedit.msc и выберите «ОК».
- Раз развернуть конфигурацию компьютера, развернуть административные шаблоны, а затем развернуть «Система».
- Дважды щелкните display Shutdown Event Tracker.
- Щелкните Включено.
- В окне «Отслеживание событий завершения работы» выберите «Всегда» и выберите «ОК».
Отслеживание событий завершения работы не является функциональным компонентом в Windows XP Home Edition. Поэтому вы не можете использовать отслеживание событий завершения работы в Windows XP Home Edition.
Корпорация Майкрософт рекомендует не включить отслеживание событий завершения работы в Windows XP Professional, планшетном ПК с Windows XP или Windows XP Media Center Edition. Корпорация Майкрософт не поддерживает использование этого компонента в этих средах Windows XP.
Настраиваемые параметры для определения причины завершения работы
В этот раздел, описание метода или задачи включены действия, содержащие указания по изменению параметров реестра. Однако неправильное изменение параметров реестра может привести к возникновению серьезных проблем. Поэтому следует в точности выполнять приведенные инструкции. Для дополнительной защиты создайте резервную копию реестра, прежде чем редактировать его. Так вы сможете восстановить реестр, если возникнет проблема. Дополнительные сведения см. в сведениях о том, как создать и восстановить реестр в Windows.
Windows предоставляет список из восьми универсальных причин, по которым компьютер был отключен. Этот список можно изменить, включив в него собственные настраиваемые причины. Чтобы добавить собственные причины, выполните следующие действия:
Откройте редактор реестра.
Найдите и выберите следующий ключ реестра: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Reliability\UserDefined
В меню «Правка» выберите «Новый» и «Много строка». При этом создается новый ключ с временным именем «New Value».
Введите имя ключа реестра в следующем формате и нажмите клавишу ВВОД: UI_control_flags; major_reason_number; minor_reason_number
Раздел UI_control_flags имени значения может содержать одно или несколько из следующих значений:
- P (указывает, что причина запланирована. Если это значение опущено, значение по умолчанию является незапланированным.)
- C или B (указывает, что требуется комментарий).)
- S (указывает, что причина должна отображаться в диалоговом окне завершения работы, инициированном пользователем.)
- Г (указывает, что причина должна отображаться в диалоговом окне неожиданного завершения работы.) Например, если вы хотите, чтобы причина отображалась в диалоговом окне неожиданного завершения работы, завершение работы будет незапланированным, а завершение работы соответствует основной причине 2 и по второстепенной причине 2, введите следующее имя значения: D;2;2
Дважды щелкните новый ключ и определите данные значения в следующем формате:
Каждое значение состоит из двух строк на отдельных строках; Первая строка является заголовком (она отображается в списке), а вторая строка — описанием (это текст, который отображается по выбранной причине).
Например, если вы хотите создать настраиваемую причину аварии, можно определить данные значения следующим образом: Natural Disaster (unplanned)
Чтобы компьютер был выключен, необходимо, чтобы компьютер был остановлен из-за затравки, а также от хлама или другого незапланированного естественного события. Укажите естественное событие в области комментария.
Windows: Shutdown/Reboot Event IDs – Get Logs
While troubleshooting an issue that causes an unexpected reboot or shutdown of a Windows machine, it is important to know which event IDs are related to system reboot/shutdown and how to find the appropriate logs.
In this note i am publishing all the event IDs related to reboots/shutdowns.
I am also showing how to display the shutdown events with date and time, using a Windows Event Viewer or from the command-line using a PowerShell.
Cool Tip: How to boot Windows in Safe Mode! Read more →
Shutdown Event IDs
The list of the Windows event IDs, related to the system shutdown/reboot:
Event ID | Description |
---|---|
41 | The system has rebooted without cleanly shutting down first. |
1074 | The system has been shutdown properly by a user or process. |
1076 | Follows after Event ID 6008 and means that the first user with shutdown privileges logged on to the server after an unexpected restart or shutdown and specified the cause. |
6005 | The Event Log service was started. Indicates the system startup. |
6006 | The Event Log service was stopped. Indicates the proper system shutdown. |
6008 | The previous system shutdown was unexpected. |
6009 | The operating system version detected at the system startup. |
6013 | The system uptime in seconds. |
Display Shutdown Logs in Event Viewer
The shutdown events with date and time can be shown using the Windows Event Viewer.
Start the Event Viewer and search for events related to the system shutdowns:
- Press the Win keybutton, search for the eventvwr and start the Event Viewer
- Expand Windows Logs on the left panel and go to System
- Right-click on System and select Filter Current Log.
- Type the following IDs in the field and click OK :
Cool Tip: Get history of previously executed commands in PowerShell! Read more →
Find Shutdown Logs using PowerShell
For example, to filter the 10000 most recent entries in the System Event Log and display only events related to the Windows shutdowns, run:
Cool Tip: Start/Stop a service in Windows from the CMD & PowerShell! Read more →
Windows Server restart / shutdown history
How can I easily see a history of every time my Windows Server has restarted or shutdown and the reason why, including user-initiated, system-initiated, and system crashed?
The Windows Event Log is an obvious answer but what is the complete list of events that I should view?
I found these posts that partially answer my question:
- Windows server last reboot time includes several answers that partially address the full restart history
- View Shutdown Event Tracker logs under Windows Server 2008 R2 includes an additional event id
- Event Log time when Computer Start up / boot up includes some of the same event ids
but those don’t cover every scenario AFAIK and the info is hard to understand because it is spread across multiple answers.
I have several versions of Windows Server so a solution that works for at least versions 2008, 2008 R2, 2012, and 2012 R2 would be ideal.
6 Answers 6
The clearest most succinct answer I could find is:
which lists these event ids to monitor (quoted but edited and reformatted from article):
- Event ID 6005 (alternate): “The event log service was started.” This is synonymous to system startup.
- Event ID 6006 (alternate): “The event log service was stopped.” This is synonymous to system shutdown.
- Event ID 6008 (alternate): «The previous system shutdown was unexpected.» Records that the system started after it was not shut down properly.
- 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. There is no TechNet page for this id.
Add to that a couple more from the Server Fault answers listed in my OP:
- 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.