Categories
All Posts Windows Server 2019 Windows Server 2022

How to create a scheduled task for Windows Reboots

Creating a scheduled task to reboot your Windows machine every night or once per week may help avoid issues such as frozen applications, windows issues where CPU or ram usage gets stuck at a high level, windows updates problems, and especially if you have an older database application that can benefit from frequent reboots.

Note: the scheduled task will reboot the machine even if other users are active – they will get message on the desktop saying “you will be signed out in approx 1 minute” or something like that.

STEPS TO CREATE A SCHEDULE TASK FOR AUTOMATIC REBOOTS

Login to machine with an account with admin rights.
Open “Task Scheduler”, then Action –> create task

GENERAL TAB:
Name: call it Reboot Server Nightly or use another name you want
Author: administrator
Description: Reboot Server [Nightly at Xpm/am]
Security Options:
Select: run whether user is logged in or not
Select: run with highest privileges

TRIGGERS TAB:
Run “daily” at Xpm/am – make sure “enabled” is checked at the bottom

ACTIONS TAB:
Action = start a program
Details, in program/script field = c:\Windows\System32\shutdown.exe
Details, in add arguments (optional) field = /r

That is all you need to do. You can monitor the machine to verify that it is working. If you ever want to see when the last time the server was rebooted, you can type this command to see that.
Open command prompt and type:
systeminfo | find /i “Boot Time”