Simple email notification when server reboots

Often overlooked is the ability to schedule a task to run at system start.  Utilizing that, you can use any number of ways to craft and send an email upon system reboot.

You can Google for a list of free smtp command line mailers to send the email or just use Blat which I’ve used for a while and works just fine.

Here’s a sample blat cmdline which can be added to a batch script or used directly in the task scheduler.

c:\utils\blat.exe -to recipient@mydomain.com -f Sender@mydomain.com -server smtp.mydomain.com -subject "Server Reboot" -body "%computername% has been rebooted."

If you want to use a mailer that’s a little more robust & includes CC,BCC, and support for SSL/TLS (can be used with gmail) and other little things, check out Send-It-Quiet (src/bin avail via Github). And a 3rd option that also supports TLS is sendEmail.

The key is to simply use task scheduler…there are quite a few delivery methods and scripts including using Powershell like this person has.

 

Advertisements