Schedule server reboot via Task Scheduler

Sometimes we need to schedule the reboot of a server after hours.

We can do this very easy with Task scheduler and PowerShell.

Open Task Scheduler and create a new basic task. Give it a meaningful name:

image

And press Next.

Set it to One time and press Next:

image

Set the date and time for the reboot, then press Next:

image

Choose Start a program, then press Next:

image

On the program name put Powershell and for the arguments put restart-computer –force, then press Next:

image

Press Finish:

image

After that the task is created, but it will not run if we logoff from the server:

image

Now we need to edit the task and make it run even if the user is not logged on and with highest privileges:

image

Press OK.

Enter your user and password, then press OK:

image

The task is now set and will reboot the server at the given time.

image

Enjoy your time and the server will reboot itself.

If you need to send a email prior to the reboot I have an article about this here.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.