?
Solved

reboot script with email

Posted on 2011-03-18
2
Medium Priority
?
340 Views
Last Modified: 2012-05-11
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?
0
Comment
Question by:alexr54
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 46

Accepted Solution

by:
Craig Beck earned 2000 total points
ID: 35167454
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
 
LVL 2

Author Comment

by:alexr54
ID: 35168073
Thanks. I think that will work, i'll try it out.
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This past year has been one of great growth and performance for OnPage. We have added many features and integrations to the product, making 2016 an awesome year. We see these steps forward as the basis for future growth.
Many of the companies I’ve worked with have embraced cloud solutions due to their desire to “get out of the datacenter business.” The ability to achieve better security and availability, and the speed with which they are able to deploy, is far grea…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question