Recipe2.18.Disabling Shutdown Tracker


Recipe 2.18. Disabling Shutdown Tracker

Problem

You want to disable the Shutdown Tracker from running at system startup on lab or test systems because it is annoying. Shutdown Tracker is a new feature of Windows Server 2003 that prompts you to provide a description of the reason why a server is being shut down or restarted. If the server unexpectedly restarted, you are prompted during logon for this information.

Solution

You need to reboot the system for the changes to take effect after performing one of the following.

Using a graphical user interface

  1. Open the Registry Editor (regedit.exe) and connect to the target machine.

  2. In the left pane, expand HKEY_LOCAL_MACHINE

    If there is no subkey called Reliability, create it by right-clicking Windows NT, selecting New Reliability.

  3. Right-click Reliability and select New

    In the right pane, type ShutdownReasonOn and hit enter. Leave the default value set to 0.

You can also disable Shutdown Tracker using group policy. The settings for it are located in Computer Configuration Administrative Templates Using a command-line interface

The following command disables the Shutdown Tracker:

> reg add "\\<ServerName>\HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Reliability" /v ShutdownReasonOn /t REG_DWORD /d 0

Using VBScript
' This code disables the Shutdown Tracker from running. ' ------ SCRIPT CONFIGURATION ------ intEnable = 0      ' 0 = disable; 1 = enable screen strComputer = "."  ' e.g., rallen-srv01 ' ------ END CONFIGURATION --------- const HKLM = &H80000002 strKeyPath = "SOFTWARE\Policies\Microsoft\Windows NT\Reliability" set objReg = GetObject("winmgmts:\\" & strComputer & _                        "\root\default:StdRegProv") intRC1 = objReg.CreateKey(HKLM,strKeyPath) intRC2 = objReg.SetDwordValue(HKLM, strKeyPath, "ShutdownReasonOn", intEnable) if intRC1 <> 0 or intRC2 <> 0 then    WScript.Echo "Error setting registry value: " & intRC else    WScript.Echo "Successfully disabled shutdown tracker" end if

Discussion

Don't get me wrong, I think the Shutdown Tracker is a very useful feature. In fact, I'm glad Microsoft added it, but it can be annoying on test systems that you want to restart or shut down frequently. After Shutdown Tracker runs, it creates event 1074 in the System event log. Here is an example:

Event Type:    Information Event Source:    USER32 Event Category:    None Event ID:    1074 Date:        10/11/2003 Time:        6:50:42 PM User:        rallen-w2k3\administrator Computer:    RALLEN-W2K3 Description: The process Explorer.EXE has initiated the restart of computer RALLEN-W2K3 on behalf of user RALLEN-W2K3\Administrator for the following reason: Other (Planned)  Reason Code: 0x85000000  Shutdown Type: restart  Comment: Just installed a hotfix.     For more information, see Help and Support Center at http://go.microsoft.com/fwlink/ events.asp. Data: 0000: 00 00 00 85               ...

You can even customize Shutdown Tracker if you want. You can create your own shutdown reasons. There are eight by default. All it takes is some more registry changes. See MS KB 293814 for more information.

See Also

Recipe 2.19 for restarting or shutting down a server, and MS KB 293814 (Description of the Shutdown Event Tracker)



Windows Server Cookbook
Windows Server Cookbook for Windows Server 2003 and Windows 2000
ISBN: 0596006330
EAN: 2147483647
Year: 2006
Pages: 380
Authors: Robbie Allen

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net