Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just set up Win Server 2008 R2 + SQL Server 2008 R2, and i'd like to schedule two tasks. One for shutting it down, or putting it to hibernate at a certain time, and one to wake him up. Both tasks should run every day. For booting up the system i tried to set up a scheduled task in the BIOS using the internal clock of the machine, but had no luck.

Any ideas?

share|improve this question
I'm not sure why you would want to put the stress on the disks by having the machine shut down each night. I use the same procedure as sysadmin1138, except its a restart bi-weekly. – DanBig Feb 1 '11 at 16:56
up vote 4 down vote accepted

For this you'll probably need a twofer.

  1. A schedule task in the OS firing off shutdown /h /t 2 at your scheduled time.
  2. One of the following:
    1. A BIOS timer to turn on your server.
    2. Leverage Wake-on-LAN and issue a Wakeup packet at the exact time you want that server powered back on.
share|improve this answer
Also, the box may have remote-admin card (DRAC, iLO) with an SSH interface that could be fed a script for the power-on. – AndyN Feb 1 '11 at 18:04
Thanks! Have to play a little bit more with the BIOS part, but that should be working... – Levi Kovacs Feb 3 '11 at 7:53

Shutdown is pretty easy. Create a scheduled task with the following command line:

shutdown /s /t 60 /c "Scheduled shutdown"

That will shut down the computer after popping up a 60-second warning. It will force any stuck programs to close, and will leave a comment in the system event log.

I can't think of any feature of Windows that would let you schedule a startup - that's normally the domain of the BIOS. In a quick test I performed on a Dell workstation, I had to enable "Auto Power On", then set the power-on time. I suspect that some other BIOS's may be less intuitive.

For a more exotic and Rube Goldberg-esque solution, you could enable wake-on-LAN and send a wake-up packet from a neighboring computer. However, I've never been able to make that work myself.

Finally, I have to wonder whether you should even be turning off your server in the first place. The vast majority of servers stay on all the time.

share|improve this answer
Seems like a reasonable way to save power, if a server's only used during the day and doesn't have great power management. – Chris Thorpe Feb 1 '11 at 23:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.