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

How do I Set a Windows 2000 Server to automatically reboot?

Status
Not open for further replies.

ScottCGI

IS-IT--Management
Dec 20, 2004
141
0
0
US
I am leery of using the task scheduler because I have had issues with it before. Any other suggestions? But if I do use it then will I have to create a batch file? What do I need to put in the batch file? I only need this to reboot one time.


 
Not too sure on the details.

Try using a batch file with the 'shutdown' command. Nick the shutdown.exe file from WinXP (System Root) and get it to run with the -r -f commands. Set the schedule using the AT command from the cmd prompt and give it a whirl.

If it's only a one off you need to restart it (e.g. just tonight) then you can set a timer on the shutdown command.
E.G;

C:\>shutdown -r -t 7200 -f

This will set the system shutdown in 2 hours! Let it run and it will restart at the designated time. The -r makes it restart, the -t sets the time in seconds and the -f forces it to shutdown, regardless of what is is doing.

Steve.

P.S. If you need to cancel it try the shutdown -a command! :)
 
I need to do it because I have a bunch of windows 2000 critcal updates I am going to download & install soon and afterwards I'll need a reboot obviously. I can't do the reboot during the day of course so I wanted to schedule it at night. I can login remotely through a citrix web browser but if I try and reboot the server that way I'm assuming it will knock out my citrix connection and that makes me nervous. All I need is one reboot and I'm done.

 
Then I would go with the shutdown.exe option. Set it a few hours before hand and apply the updates etc. When the time runs out your server will be restarted automatically.

Steve.
 
I would be more nervous using the shutdown.exe command, but that is just me... I usually just do reboots through Terminal Services. After I begin the reboot, I do a continous ping until I see the server go down and back up again. Then I go back in TS to verify it is ok.
 
If you want to setup a scheduled task to reboot the Terminal Server, I would use tsshutdn (system32 folder) rather than shutdown.exe. tsshutdn is used in terminal server environments...it can take in consideration any opened sessions as well as notify those open sessions that you are rebooting the server.
C:\WINNT\system32\tsshutdn.exe /reboot /v
 
Well, let me ask this... I can login to the server remotely from home through a citrix web browser. Are there any dangers of rebooting the server that way? I know, or at least I think I'll lose my connection once it reboots but I guess that doesn't matter as long as it does the job. I normally leave this server logged in so I have a "newbie" question here... will all the services start normally after the reboot even if the server has not been logged into?

Scott
 
Let me also add that if you're running Metaframe XP, you have the capability of scheduling a reboot, if that's what you really want to do.

As for services starting up w/o being logged in, that is generally true, but it depends on the service itself. Some of them needs some intervention to get them going, some don't. I never trust anything, so I always go back in after a reboot and make sure things are ok. Especially after installing updates, I've had instances where stuff didn't work anymore.

As for being nervous about losing the connection during a reboot from home, you might want to consider something that allows you to have control of the console remotely, regardless of the state of the operating system. Like HP/Compaq Proliant servers either have built in capability or something you can buy that will allow you to do this from over a network or modem connection. I'm sure other manufacturers have similar stuff, I'm just not familiar with them.

 
Basically, either of them will work.

If you are running any remote control software such as Terminal Services, Citrix or even TightVNC then go for it. If there is no way for you to do it locally you can shutdown using the shutdown.exe (never had any problems with it) or if you are sitting infront of a PC after the updates have applied then you can shutdown from a remote session and all should be OK.
Like klklkl said if you are running Metaframe XP then you can shedule a reboot using it.

You will loose your remote session when it reboots if you shut it down from a Citrix session. Although klklkl is right in saying that you shouldn't leave things to chance when doing an update, I'd go with the 'shutdown manually in a remote citrix session' option or if you want to schedule it I would use the shutdown.exe option.
The likelyhood of the update failing so badly that it knackers you server is very slim, but still possible.
Either way, if your not going to be at the local PC when the updates happen there isn't much choice.

Schedule - shutdown.exe
Real-Time - Shutdown from a remote session

The choice is yours! :)

Steve.
 
Alright. This is our exchange server... we have 3 other servers that we run metaframe xp on. I am leaning towards doing the reboot remotely from home, waiting a few minutes, and then logging back in to ensure all the services are running. Thanx for the info!

 
I'd for for the reboot from home. With products like 2000 - they are reliable. Updates should be handled with caution, but as long as it's no major SP then I'd do it remotely.

Just one thing - couldn't you run the update and restart it tomorrow morning first thing?

P.S. If you do end up using the shutdown.exe then make sure you use the -r switch otherwise it will just log off! :)
 
I actually already ran the updates (22 critical updates) but elected to not reboot immediately. I wish I could reboot first thing in the morning but I have a shipping department that starts at 5:00AM!!! Not only that but I also have people in Denver (I'm in MIlwaukee) that are 2 hours ahead of me. It makes it very difficult to schedule these kinds of things. Thanks again!

 
I DON'T KNOW IF YOU WILL USE A THIRD PARTY SOFTWARE TO DO THIS.IF YOU DO THEN GO TO AND DOWN LOAD A UTILITY CALLED TIMED SHUT DOWN. I THINK IT IS UNDER THE MISC.CATAGORY.YOU CAN DO REBOOT,SHUT DOWN HEBERNATE ETC.AT YOUR CHOOSEN TIME.
 
Never used the product, but it sounds similar to the SHUTDOWN.exe which comes with XP. Copy the .exe to wither Win2k or Win2k3 boxes and it does the same for free.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top