Scheduling scripts is a big part of a automation but you may be struggling to get your scripts working using the native task scheduler. This post covers how to get past the initial hurdles.
Step 1 – Open Task Scheduler and create a new task
Step 2 – Name the task, and set the security options (use an account that has the permissions to run your script and the commands within it, unless you are using the -Credentials parameter on your commandlets)
Step 3 – Set your triggers
I have set mine to hourly in this example.
Step 4- Set your actions
You will want to start a program, and that program will be Powershell. You will also pass the script that you want to run as an argument for Powershell to run when the schedule is triggered.
Add arguments: -File “C:\Web\Scripts\EUCTools\Dashboard\EUC_TestCSFederatedPartner_Schedule.ps1”
Start in: C:\WINDOWS\system32\WindowsPowerShell\v1.0
Step 5 – Completion
You can leave the rest as is and save your changes. You will now have a schedule that will run your Powershell script!