Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

script to do a scheduled reboot

Status
Not open for further replies.

jcck2003

IS-IT--Management
Mar 21, 2003
168
US
Hi all:

we have a NT4 sp6 server kept running into trouble, it is running Exchange, I have create a batch file to stop all the critical services, sometimes it need to be reboot (and a hammer I would add), we need to schedule it in the off hours.

is there a way to schedule the machine to do a schedule reboot ? what is the command

thanks for your help
J
 
There is a shutdown.exe program for NT 4.0. It may be on the supplement CD. I know I found it on the web. It allows shutdown of local and remote servers.
 
The following information needs to be put into a batch file:

REM // stop all services
echo Stopping Services...
net stop MSExchangeMSMI
net stop MSExchangePCMTA
net stop MSExchangeFB
net stop MSExchangeDX
net stop MSExchangeIMC
net stop MSExchangeMTA
net stop MSExchangeIS
net stop MSExchangeDS
net stop MSExchangeSA

REM // shutting down the server and rebooting
echo shutting down
shutdown [\\computername] [/r] [/t:30] ["msg" shutting down] [/c]

Then save the file as like exchangestop.bat (whatever you want).

Then go to a command prompt and schedule it to the time you want using the "at" command.

at 00:00 /every:M,T,W,Th,F c:\stopexchange.bat

this would schedule exchange services to be stopped at midnight every weekday, and then a reboot of the server will occur. Of course change the parameters to what you need (like just monday or whatever). also fill in the information above to what you need.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top