reboot script with email

Can someone please help me with a script which i can set as an automated task which will reboot a server, but send and Email warning 15 minutes prior to reboot?
LVL 2
alexr54Asked:
Who is Participating?
 
Craig BeckConnect With a Mentor Commented:
Download a command-line SMTP mailer such as BLAT.  Then create the following BAT file...

BLAT -server <mailserverip> -i <senderaddress> -t <toaddress> -s "Server Restarting..." -body "The server <servername> will restart in 15 minutes!"
shutdown -r -t 900

Obviously change the <mailserverip> to the IP address of a SMTP server on your network, and set the <senderaddress> and <toaddress> to the relevant values.

Schedule that BAT file to run and it should email then restart the server 15 minutes later.
0
 
alexr54Author Commented:
Thanks. I think that will work, i'll try it out.
0
All Courses

From novice to tech pro — start learning today.