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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automated Restart of 2000 Server using scripts or triggers 1

Status
Not open for further replies.

blipper

Programmer
Jan 8, 2004
9
GB
How do I schedule a restart of my Windows 2000 Server?

I'm open to all suggestions, if there is a script I could run or if there is a way from within a VB application I could write?

Please let me know.
 
You can use the Task Scheduler and the shutdown.exe command from the
Resource Kit
to accomplish this.
This works pretty well, but beware if the machine is running SQL
server or Exchange Server. You might want to write a command script
that shuts down the SQL/Exchange services first before it invokes the
shutdown command and schedule the script instead.

"Sometimes I do not know but I try hard"- R.F. Haughty 1923
 
You can use "shutdown.exe" with the appropriate switches and load this into your scheduler.

 
You can also use on a workstation or regular server:

TsshutdnEnables an administrator to remotely shut down or reboot a terminal server. You can also choose to power off the server if the computer supports software control of AC power.

Syntax
tsshutdn [WaitTime] [/server:ServerName] [/reboot] [/powerdown] [/delay:LogOffDelay] [/v]

Parameters
WaitTime
After notifying users, specifies an amount of time (in seconds) to wait before logging off all users from their sessions. The default is 60 seconds.
/server:ServerName
Specifies the terminal server to shut down. If unspecified, the current terminal server is shut down.
/reboot
Reboots the terminal server after user sessions are ended.
/powerdown
Turns off the terminal server if the computer supports software control of AC power.
/delay:LogOffDelay
After logging off users from their sessions, specifies the amount of time to wait before ending all processes and shutting down the terminal server. The default is 30 seconds.
/v
Displays information about the actions being performed.
/?
Displays help at the command prompt.
Remarks
You must have administrative privileges run tsshutdn.
Using Shut Down on the Start menu is not recommended for shutting down a terminal server. This method does not notify users before ending their sessions.
All connected sessions are notified that they are going to be shut down. Sessions that have applications with open files prompt the user to save the files. After initiating the logoff command, tsshutdn waits a specified interval (the default is 30 seconds, which is set by /delay), before ending all processes.
Tsshutdn does not reboot the terminal server unless the /reboot option is specified.

Be certain that if you schedule using the AT feature or through Task Scheduler that you modify the normal credentials to that of a server Administrator and password, as the normal System account that otherwise would be used by default will not succeeed.

This is true for either Shutdown.exe or Tsshutdn.exe.
 
bcaster,

How do I stop a server that automatically shuts down? I no longer want our server to automatically reboot as it does? How can this be stopped?
 
Control Panel, Scheduled Tasks should show the task creating the shutdown. Either delete the task or modify its schedule.
 
Thanks, that sped up my systems, logging out users etc. cheers for the help :)
 
bcaster,

No tasks for shutdown. When searched for shutdown.exe can not locate such file, checked all services - none set to restart the server.

Thanks.
 
saddatabid,

Shutdown.exe comes with the resource kit for Win2k and is not a native utility.

What you need to look for is a Scheduled Task, not a Service. Control Panel, Scheduled Tasks.
 
Saddatabid,
I hope it's not a Blue Screen that makes your server reboot! First check your 'Startup and Recovery' Settings, if these are set to reboot your server upon errors, check your Event Viewer for errors.

Michael
 
The only other thought I had was to check the BIOS.

More common with notebooks, there is a feature in some BIOS to enable scheduled shutdowns, sleep or reboots.

Seems unlikely for a server BIOS, but most certainly should be checked on the server. Disable any entry found.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top