Wake up Neo
November 22, 2011 2 Comments
I recently installed Windows Home Server 2011 on one of my old desktop computers. While Home Server is a great product which is easy to use, I couldn’t find a way in the UI to schedule sleep and awake times for my server. I know, I know it’s a server and it should run 24/7, but I don’t have one of those fancy, low powered, silent boxes. My old desktop has 500W power supply and makes some noise in the closet. Therefore I wanna put the server to sleep around 10pm and wake him up around 7am. If you don’t wanna do the configuration by hand then you can stop reading and buy a great Addin for your Home Server called Lights-Out http://www.wegotserved.com/2010/09/20/lightsout-v2/ that gives you the functionality plus additional features. However, I wasn’t willing to pay the license fee, plus I’m a geek and I thought there must be a way to do this with on board tools. The key component to get it working is this rundll32 call.
rundll32 powrprof.dll,SetSuspendState 0,1,0
It sets your computer to the configured suspend state. The 1 in the parameter list forces the sleep. Otherwise the sleep request can be rejected by any component or running software. You should also check whether the S3 mode works on your configuration. I my case a missing video driver caused that the S3 state wasn’t available. Here nice little tool to check your suspend states MCE StandBy Tool. Once you made sure that the suspend works on your Home Server, we can setup some tasks in the task scheduler.
First the one that puts our server to sleep. Open the Task Scheduler from Administrative Tools under the Start Menu
Now click the “Create Task…” action on the right side of the task scheduler and give the task a meaningful name. Also check the “Run whether user is logged on or not” radio button.
Next click on Triggers and add a new Trigger. In my case I wanna run the task on a schedule daily at 10 pm.
Now add the action to put the server to sleep under the Actions tab. The full line for the arguments is powrprof.dll,SetSuspendState 0,1,0
Ok now we need to wake up the server in the morning. Therefor we don’t need a special program because the Task Scheduler already has the option to wake up a computer for a certain task. So lets add another Task.
Add a Trigger at 7 am.
Since an action is required, we just add an action that is doing nothing, like cmd.exe /c.
Now the important part for this task is to set the option “Wake the computer to run this task” under the Conditions tab.
If you wanna wake up the server out of band then you can use any of those Wake On LAN tools you can find on the internet.
interesting… I do work much with .dll but your tutorials made it easy for me.
thanks.
Awesome, this exactly what I was looking for…