2

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?

1
  • 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, 2011 at 16:56

2 Answers 2

4

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.
2
  • 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, 2011 at 18:04
  • Thanks! Have to play a little bit more with the BIOS part, but that should be working... Feb 3, 2011 at 7:53
1

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.

1
  • 1
    Seems like a reasonable way to save power, if a server's only used during the day and doesn't have great power management. Feb 1, 2011 at 23:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .