The free Windows Server 2003 Resource Kit tools contain Custreasonedit.exe, a command-line and GUI tool that allows users to add, modify, and delete custom reasons used by the Windows Server 2003 Shutdown Event Tracker.
The ReadMe.htm file contains:
Custom Reason Editor (CustReasonEdit) is a command-line and GUI tool that allows users to add, modify, and delete custom reasons used by the Shutdown Event Tracker on the Windows Server 2003 operating system. There are two ways to use this tool: Use the command line to perform basic importing and exporting of custom reasons to a registry file, or use the GUI to perform all other types of custom reason editing. CustReasonEdit includes a set of sample reasons to help you get started.
Shutdown Event Tracker helps system administrators track reasons for system down-time by collecting these reasons at the time of shutdown and logging this data to the event log. For more information about the Shutdown Event Tracker component, see Help and Support Center.
The following are the system requirements for this tool:
- Windows Server 2003 operating system.
- You must be an Administrator on the local computer.
Reviewing Best Practices
Use the table below to identify best practices you should use when working with custom reasons.
|Use built-in reasons whenever possible.||It is recommended that you use built-in reasons where possible. By using built-in reasons, you will ensure that your annotations are compatible with any future technology released by Microsoft that relates to reasons why you shut down your computer.|
|Add custom reasons for specific reboot or shutdown reasons.||Add custom reasons when the custom reason will help to identify a specific reason for the shutdown. For example, it is not useful to see that 50% of the reboots in a data center were due to cause "Other". On the other hand, if there is a specific application setting that requires a shutdown, that is a good candidate for a custom reason.|
|Require comments if reasons are not specific enough.||If a reason is very general, consider requiring a comment for that reason instead of creating a custom reason. Comments ensure that the user is prompted to be more specific. When the data is reviewed months or years later, the greater detail can help to explain the root cause of the shutdown.|
|Use correct categories, distinct titles, and clear descriptions.||The Shutdown Event Tracker displays valid custom reasons. It is the responsibility of the user to enter descriptive, distinct names and proper categories. Doing so will help system operators to quickly choose the correct reboot reason from the Shutdown Event Tracker dialog box.|
|Create task-based reasons.||Create custom reasons based on the task that the user is performing at the time of a shutdown. For example, consider using a reason title of "Failure Recovery: Application" instead of a reason title of "Application: Failure Recovery." Using task-based reasons helps users pick correct annotations quickly from a long list of options.|
Installing the Sample Reason Package
To use the sample reasons included with CustReasonEdit, you must install them first.
To install the sample reason package:
- Navigate to the folder where the Resource Kit Tools are installed.
- Right-click the file Samplereasons.reg, and then click Merge on the shortcut menu.
This adds the set of sample reasons to the local system.
Installing the sample reason package will also disable built-in reasons. For more information, see "Disabling Built-in Reasons" later in this topic.
Localizing Custom Reasons
The Shutdown Event Tracker displays custom reasons corresponding to the system locale, not the user locale. For more information about System Locale, see Help and Support Center. CustReasonEdit stores custom reasons for the system locale on the host system; however, it accepts input in any language. For example, if the user creates custom reasons by using Japanese characters on an English language version system, these reasons will be displayed in Japanese characters by the Shutdown Event Tracker on the English language version system, as long as the necessary code page is installed in the operating system.
Testing Custom Reasons
On a system on which the Shutdown Event Tracker is enabled, you can test custom reasons created by CustReasonEdit. Click Shut Down on the Start menu. The Shut Down Windows dialog box should display the custom reasons you created.
Deploying Custom Reasons
Use CustReasonEdit to create well-formed custom reasons on a single computer. The following list describes several options for deploying these reasons to a wider range of computers.
- A file can be exported by using the command-line export command, and this file can then be imported by CustReasonEdit on every system.
- The GUI can be used to connect to each system and populate the custom reasons.
- Group Policy can be used to propagate the registry subkey where custom reasons are stored. To accomplish this, use Group Policy to propagate the following subkey and all of its entries:
Disabling Built-in Reasons
You can exclude built-in reasons from the Shutdown Event Tracker list and use custom reasons only. In the registry editor Regedit.exe, navigate to:
Create the registry entry ShutdownIgnorePredefinedReasons with the data type DWORD, and the value set to 1.
To re-enable built-in reasons, set the value of the entry ShutdownIgnorePredefinedReasons to 0.
custreasonedit \[/i\] \[/l\] \[/e FileName\] \[/r FileName\] \[/s\] \[/m Host\] \[/?\]
- Opens the GUI window for complete editing of shutdown reasons.
- Lists the existing shutdown reasons.
- /e FileName
- Exports the custom reason subkey to a registry file named FileName.
- /r FileName
- Imports the custom reason subkey to a registry file named FileName.
- Runs CustReasonEdit using the system locale for custom reasons.
- /m Host
- Allows you to connect to a remote system to import or export custom reasons
- Displays command-line usage.
To access the GUI you must type the following at a command prompt: custreasonedit /i. By default, the list of custom reasons are populated with the list of custom reasons installed on the local system. For information about the reason attributes such as Planned, Expected Shutdown, and Unexpected Shutdown, see the Shutdown Event Tracker documentation in Help and Support Center.
CustReasonEdit contains the following windows:
Custom Reason Editor window
|Custom Reason List||Displays the custom reasons you have added or imported.|
|Import||Opens a window to browse for the registry file to import.|
|Export||Opens a window to browse for the registry file to export.|
|Reason Category||Lists the reasons why you might want to shut down your computer. These categories correspond to the major categories of the default reasons used by Windows. Use this list to assign a reason category to your custom reason.|
|Minor Code||Specifies a number between 1 and 1000. This number must be different from an existing minor code. Minor codes are created based on the combination of the following attributes: Reason Category, Planned, Unexpected Shutdown, and Expected Shutdown.|
|Planned||Specifies that this custom reason applies to a planned shutdown.|
|Comment Required||Specifies that this custom reason requires the user to enter a comment before the computer can be shut down.|
|Unexpected Shutdown||Displays this reason in the Unexpected Shutdown dialog boxes.|
|Expected Shutdown||Displays this reason in the Expected Shutdown dialog boxes.|
|Title||Describes the reason category in 64 characters or less.|
|Description||Describes the reason in detail in 256 characters or less.|
|Remove||Removes the selected custom reason from the Custom Reason List.|
|Add||Adds the new custom reason to the Custom Reason List.|
|Update||Saves any changes you make to a selected custom reason.|
|Exit||Closes the Custom Reason Editor window.|
Switch to Another Computer window
|Local Computer||Specifies that you are using a local system to import, export, or edit custom reasons.|
|Network Computer||Specifies that you are connecting to a remote system to import, export, or edit custom reasons.|
|Network Computer Name||Specifies the name of the remote computer.|
Add a Custom Reason
The task in this example is to use the CustReasonEdit UI to add a custom reason.
- Type the following at the command line:
- Press ENTER. The Custom Reason Editor window opens.
- Under Reason Category, select a reason category corresponding to the major category of the default reasons used by Windows.
- If this reason should be used for planned shutdowns, select the Planned check box.
- If this reason requires users to add a comment before they can shut down the computer, select the Comment Required check box.
- To indicate whether this reason should be displayed in the Unexpected Shutdown or Expected Shutdown dialog boxes, select at least one of the Unexpected Shutdown and Expected Shutdown check boxes.
- In the Minor Code box, enter a number between 1 and 1000 that is different from an existing minor code. Minor codes are created based on the combination of the following attributes: Reason Category, Planned, Unexpected Shutdown, and Expected Shutdown.
- In the Title box, type a title for the reason category in 64 characters or less.
- In the Description box, type a detailed description of the reason in 256 characters or less.
- Click Add to add the reason to the system.