Powershell - To schedule a task from the Task Scheduler

To schedule a task from the Task Scheduler, follow these steps:


  1. Open the Task Scheduler MMC snap-in. Task Scheduler is located in either Control Panel\System and Security\Administrative Tools\Task Scheduler or Control Panel\Administrative Tools\Task Scheduler, depending on the version of Windows installed.
  2. Select Create Task.
  3. Enter a Task Name like Windows PowerShell automated script.
  4. Select Run Whether User Is Logged On Or Not and chose to store the password.
  5. Select Change User Or Group to enter a user that has the proper privileges to execute this PowerShell script.
  6. In the Triggers tab, enter the schedule you would like to create for this scheduled task. For example, you can chose to run this script daily at 8 p.m.
  7. In the Actions tab, as shown in Figure 8.13, add a new action and select Start A Program. In the program path, enter D:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe.
  8. Click OK and enter the password for the account that will execute the scheduled task.
  9. From the Task Scheduler MMC, you can view all your scheduled tasks, check for their last run time, and see if there were any errors in execution based on the last run result.