34

How can I suppress giving a reason for shutdown on a Windows Server host?

Specifically, on 2008 R2, but all versions back to 2003 and up to 2012 would be appreciated.

Knuckle-Dragger
  • 366
  • 1
  • 2
  • 13
warren
  • 17,829
  • 23
  • 82
  • 134

4 Answers4

49

You will need to modify the group policy that is applied to the servers. Open up the Group Policy Management Console and navigate to Computer Configuration >> Administrative Templates >> System and select "Display Shutdown Event Tracker." Disable that option.

Wesley
  • 32,320
  • 9
  • 80
  • 116
  • I like (and had forgotten about) @[xeon](http://serverfault.com/users/10695/xeon)'s [answer](http://serverfault.com/a/560512/2321), but this is more inline with what I was hoping to find :) – warren Dec 11 '13 at 16:29
  • 2
    The "Group Policy Management Console" can be opened via Win+R and then executing `gpedit.msc`. – Sebastian Krysmanski Jun 07 '14 at 17:59
22

If you do not want to change via Polices you can always issue the shutdown command to avoid the question.

shutdown /s /t 0

/s = shutdown /t = time till shutdown 0 = immediely

xeon
  • 3,796
  • 17
  • 18
  • 3
    +1, I do not get the downvotes, you answered the question perfectly. – natxo asenjo Dec 10 '13 at 23:03
  • 3
    +1, even though this may not be the permanent solution that OP had in mind, you are technically correct in that this does shut down without a prompt. – Ryan Ries Dec 10 '13 at 23:07
  • if you always shut the host down like this, then it is the permanent solution ;-) – natxo asenjo Dec 10 '13 at 23:14
  • 3
    I downvoted because I wrongly interpreted the OP to have explicitly wanted a one-time change that would permanently shut down the shutdown event tracker. I realize that this, while perhaps not what most sysadmins would consider to be a permanent solution, is still valid. Downvote retracted. – Wesley Dec 11 '13 at 05:03
  • In actual fact, this more accurately answers OP's question which was how to *suppress* (not disable) the prompt. – Valiante Sep 19 '22 at 16:51
15

Running the following as an elevated admin:

reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Reliability" /v ShutDownReasonOn /t REG_DWORD /d 0 /f

and then logging off and on again should to the trick.

This is quicker than using group policies which you should use when you are in a domain and want to apply this change to many servers.

Peter Hahndorf
  • 13,763
  • 3
  • 37
  • 58
  • 1
    Not sure if this one is for pre-Windows 2012 R2, but on 2012 R2 this registry path is invalid and should be: reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Reliability" /v ShutDownReasonOn /t REG_DWORD /d 0 /f – Koen Zomers May 24 '16 at 21:38
  • @KoenZomers - You are correct, there was an extra 'control' in the path, 9 people up-voted and nobody noticed. I fixed the answer. – Peter Hahndorf May 25 '16 at 06:47
9

I'm sure the OP has found the other answers useful but future readers may be interested in a powershell version. Works out of the box in 2008 or up, and maybe in 2003 if powershell is installed.

    if ( -Not (Test-Path 'registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Reliability'))
    {
    New-Item -Path 'registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT' -Name Reliability -Force
    }
    Set-ItemProperty -Path 'registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Reliability' -Name ShutdownReasonOn -Value 0
#

or a .reg file version. Install with "regedit /s Disable_Shutdown_Event_Tracker.reg"

Disable_Shutdown_Event_Tracker.reg

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Reliability]
"ShutdownReasonOn"=dword:00000000
Knuckle-Dragger
  • 366
  • 1
  • 2
  • 13