Jump to content

Merge notifications at shutdown or reboot


Recommended Posts



when you shut down or reboot the server, you receive quite a lot of notifications about services going down. Is it possible to somehow detect that shutdown/reboot has been issued and suppress all notifications for monitored services until next start?

Link to comment
Share on other sites

As I have a plan to controll ALL servers I manage, there would be over 100 different answers :)


so, it depends...Windows servers are rebooted more often to apply patches, Linux server once a year. I noticed the above mentioned symptom on Windows server, but I cannot confirm it happens on all installations. The particular ones I observe took 7-10 minutes to shut down (Exchange servers)

Link to comment
Share on other sites

  • Administrators

Usually Exchange servers shutdown like that because they are installed on the same machine with the Active Directory Controller. The symptom is that the ADDS services shutdown before exchange does and Exchange waits for a reply from a query he makes to AD. As far as I know the timeout is set to five minutes.


I've reduced that timeout on my exchange server to 30 seconds and the machine shutsdown faster now.

Link to comment
Share on other sites

Paul, that's very good tip!

As you guessed, it's about SBS servers. On "normal" topology I never allow Exchange to be installed on DC, but on SBS I don't have much choice. 


I've digged google a bit, but I cannot find where to change this timeout. Can you help? :)

Link to comment
Share on other sites

  • Administrators

Right so you pretty much have two solutions over here:


  1. Reduce the time to kill amount to something acceptable (20 seconds maybe?). This value controls the amount of milliseconds it allows a service to shutdown before the system will actually kill it in order to proceed with shutdown. You will find that value here: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\WaitToKillServiceTimeout
  2. Manually stop Exchange services before shutting down the machine. Create a batch script called shutdown_properly.bat and put it into a directory that's inside your PATH variable. In that batch script put something like this:
@echo off
echo 'Stopping Microsoft Exchange Services'
net stop MSExchangeAB
net stop MSExchangeADTopology
net stop MSExchangeAntispamUpdate
net stop MSExchangeEdgeSync
net stop MSExchangeFBA
net stop MSExchangeFDS
net stop MSExchangeIS
net stop MSExchangeMailboxAssistants
net stop MSExchangeMailboxReplication
net stop MSExchangeMailSubmission
net stop MSExchangeProtectedServiceHost
net stop MSExchangeRepl
net stop MSExchangeRPC
net stop MSExchangeSA
net stop MSExchangeSearch
net stop MSExchangeServiceHost
net stop MSExchangeThrottling
net stop MSExchangeTransport
net stop MSExchangeTransportLogSearch
shutdown -s -t 00

The last line on the batch script will call the system shutdown without forcing applications to close. In other words it will be a nice and clean shutdown just the way your server likes it. If you would like a reboot instead you can modify the last line to something like this:

shutdown -r -t 00

Please note that the batch script will differ from Microsoft Exchange Server versions. The one I wrote to you works only with Microsoft Exchange Server 2010. If you are using a different version I recommend you to add the correct exchange services and remove the ones that are not installed on your system.


Then if you would like to shutdown or restart you machine from your PC Monitor client open up terminal and write the batch file's name (Now you see why I made you place it into a directory inside the PATH variable, otherwise you would have to write the full path to the file too).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...