Scheduled task Setup Notes - Oliver-Mustoe/Oliver-Mustoe-Tech-Journal GitHub Wiki

In this page I detail how I setup a scheduled task on A Windows 10 VM

Notes

The examples given are for this specific lab, but these steps can be taken with any task

First I logged in as a administrator and used the "run" program, with the command "taskschd.msc", opened Task Scheduler. I then right-clicked on Task Scheduler Library > Create Task which brought up a configuration screen for the task.

In the general tab I filled out the Name tab with a name, for example "ping", for the task as well as configured, in the security options, for the task to be run with highest privileges.

In the triggers tab I set a trigger for the task, for example "On a schedule", along with when it would start, for example "One time." I also went into the Advanced settings and configured the triggers settings, for example repeat every 5 minutes indefinitely.

In the actions tab I set the action, for example start a program, and in the "Program/script" section, since we are using PowerShell, I entered the path to powershell.exe. This is located somewhere like "C:\Windows\System32\WindowsPowerShell\v1. 0\powershell.exe". In the "Start in" section I used the argument command and entered the path to the PowerShell file I wished to start. The written out command is " -Command "& 'SCRIPT PATH HERE'" ".

For this task I did not have to change anything in the conditions or settings section, but they are there for more customization.

After all of this I pressed ok and right-clicked my command to run it and can later right-click it to end it as well.

SOURCES:
https://o365reports.com/2019/08/02/schedule-powershell-script-task-scheduler/
https://get-cmd.com/?p=5018