# Make win2k8 server email me when it shuts down



## admoore (Aug 30, 2011)

I have a Windows 2008 server 64-bit running our SQL Server database. 

Every now and then, due to updates or other issues with the system, it reboots. When this happens, it would be nice to be aware of it right away.

Is there a way to have Windows email me when it's going to shutdown or reboot?

I looked in the task scheduler, but I don't see any triggers for shutdown or reboot. I don't really want it to email me when it's manually rebooted, but if that's how it has to work, that's ok.


----------



## valis (Sep 24, 2004)

Are you the only person with access to it? I wouldn't let it reboot automatically, personally. I have all of mine set to notify me that they want to reboot, and to wait for me to okay it. 

I don't know of a way off the top of my head to make it email you when it restarts.


----------



## DoubleHelix (Dec 10, 2004)

You would have to purchase and install 3rd party server monitoring tools to do this type of notification.


----------



## admoore (Aug 30, 2011)

After the latest episode, I turned off automatic updates. Not ideal, but better than coming in to bedlam on Wednesday mornings.

There is seriously nothing built into this OS to do email alerts??

Valis, how do they notify you, and how did you set this up?


----------



## admoore (Aug 30, 2011)

Ok, I _may_ have a working solution. I found in the task scheduler that I can trigger on an event log event, so I'm watching for event 22 from WindowsUpdateService in the system log, which should indicate the need to reboot after an update.

One the actions allowed me to send an email to, so it possible to send an email after all.

Not sure if it will work, since I didn't see any way to test it, but it's worth a try!


----------



## valis (Sep 24, 2004)

It's just a standard icon in the notification area; 'this computer has been updated and needs to be rebooted in order to complete it'.......and truthfully, I use a SUS server so I manually push out approved updates one weekend a month......


----------



## admoore (Aug 30, 2011)

valis said:


> It's just a standard icon in the notification area; 'this computer has been updated and needs to be rebooted in order to complete it'.......and truthfully, I use a SUS server so I manually push out approved updates one weekend a month......


Ah ok. I don't hit the console of this box very often, so anything local does me no good. We don't use AD here so SUS is a no-go for now.

Thanks for the help, I may have sorted this one out.


----------



## Rockn (Jul 29, 2001)

How is a server going to send an alert when it is rebooting? Like was stated before there are third part monitoring tools that can monitor server "heart beat" as well as the status of services on the server. Ideally you don't want Windows update to have that sort of control over your server. You would probably be better off setting it to download updates and let it do it's thing on a Friday and you monitor it's completion.


----------



## admoore (Aug 30, 2011)

Rockn said:


> How is a server going to send an alert when it is rebooting?


Clearly, it's not possible _when_ it's rebooting, but one would think it's possible (at least with an actual reboot, as opposed to power loss or hard shutdown) to hook into the reboot process and fire off an email before anything actually shuts down.



> Like was stated before there are third part monitoring tools that can monitor server "heart beat" as well as the status of services on the server. Ideally you don't want Windows update to have that sort of control over your server. You would probably be better off setting it to download updates and let it do it's thing on a Friday and you monitor it's completion.


Thanks. I've disabled automatic updates now, and it will (in theory) alert me when it needs a reboot.


----------



## Rockn (Jul 29, 2001)

If automatic updates are turned off it will not download them so it will not need to reboot. There is no way to do it without some sort of third party tools. It is what it is.


----------

