Schedule A Server Reboot After Hours

It’s easier to schedule a production server reboot for after hours than it is to come in early or stay late.

These instructions will take you through scheduling a reboot for a Windows machine. You don’t need a script for this, just some basic knowledge of Windows’ task scheduler (which seems to get worse with each new Windows edition…). The instructions were written using Windows Server 2012.

RDP to the Machine in Question
You can login as any administrative user.
Open Task Scheduler
Located in Administrative Tools. You can also search for task scheduler on the Start page.
2017-07-06 10_27_31-jll-backup-02 - Remote Desktop Connection.png
Create a Basic Task
Expand the Task Scheduler Library and right-click to create a basic task. The screenshot below shows the task I already created.
2015-09-10 18_08_57-jll-dc-03 - Remote Desktop Connection (1).png
The same option is available in the Action menu.
2015-09-10 18_11_00-jll-dc-03 - Remote Desktop Connection.png
Name the Task. Add the Description as Necessary
2015-09-10 18_11_59-jll-dc-03 - Remote Desktop Connection.png
Set the Trigger
Select One Time to schedule the reboot for a specific date and time.
2015-09-10 18_12_46-jll-dc-03 - Remote Desktop Connection.png
Set Your Desired Date and Time
2015-09-10 18_14_06-jll-dc-03 - Remote Desktop Connection.png
Select the Action
You want Start a Program
2015-09-10 18_14_44-jll-dc-03 - Remote Desktop Connection.png
Set the Program and Arguments
In the Program/script field, type just Powershell.exe
In the Add arguments field, type restart-computer -force
Note the important space between restart-server and -force.
2017-07-06 10_48_23-Create Basic Task Wizard.png
Confirm and Finish
Select Finish
2015-09-10 18_17_40-jll-dc-03 - Remote Desktop Connection.png
Ensure the Task Runs When You’re Gone
Once you click Finish, the Create Basic Task Wizard window will close. Right-click your new task and select properties. Open the tasks’s General tab and then select Run whether user is logged on or not.  Click OK.
2015-09-10 18_19_46-jll-dc-03 - Remote Desktop Connection.png
You will be asked to enter credentials. Use credentials that will have the authority to restart the server. Be careful about using the Administrator credentials, or those of a staff member, which could change.