Schedule Windows Server 2008 R2 to boot and shutdown
Solution 1
For this you'll probably need a twofer.
- A schedule task in the OS firing off
shutdown /h /t 2
at your scheduled time. - One of the following:
- A BIOS timer to turn on your server.
- Leverage Wake-on-LAN and issue a Wakeup packet at the exact time you want that server powered back on.
Solution 2
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.
Related videos on Youtube
Levi Kovacs
I am the founder of Acid Media, a software development company. I have founded this company with the vision of making the web a better place!
Updated on September 17, 2022Comments
-
Levi Kovacs over 1 year
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?
-
AndyN over 13 yearsAlso, the box may have remote-admin card (DRAC, iLO) with an SSH interface that could be fed a script for the power-on.
-
Aashraya Singal over 13 yearsSeems like a reasonable way to save power, if a server's only used during the day and doesn't have great power management.
-
Levi Kovacs about 13 yearsThanks! Have to play a little bit more with the BIOS part, but that should be working...