Automating sleep

Copper Contributor

Hello all,


Can someone point me in the right direction? I'm trying to make my server sleep at night and wake in the morning (simply for sheer cost of electricity). I can easily get it to do this at specific times but i want it to only do it only when idle between 12 and 7 under away mode.


In the past I've turned the caffiene app (presses a key every second) on and off at required times and had sleep on permenantly. It was messy but kind of worked.


Isn't there a way/script (BAT or powershell, i know both at an amuture level) so i can turn sleep on at 12 and then off at 7 after the server has resumed from sleep using away mode? This way it also stays awake for Plex streaming.


Many thanks in advance. This forum was a goldmine to fine.

3 Replies
if its physical server you can check available settings on IDRAC or ILO, you can use SNMP based commands from a remote machine if there is no option for scheduling start and stop.



Many thanks for the reply. I'm using windows server 2022 on standard home hardware. I assume the systems you mentioned above aren't compatible. (I don't understand what they are even after a little googling)

best response confirmed by Pickles (Copper Contributor)
Figured it out through other peoples posts.
thought id post to help others. Embarrisingly its very simple. BAT file with the following 4 commands:

Powercfg /Change monitor-timeout-ac 0
Powercfg /Change monitor-timeout-dc 0
Powercfg /Change standby-timeout-ac 0
Powercfg /Change standby-timeout-dc 0

change zero to a number for minutes to turn it on
0 is off