Jasinski Technical Wiki

Navigation

Home Page
Index
All Pages

Quick Search
»
Advanced Search »

Contributor Links

Create a new Page
Administration
File Management
Login/Logout
Your Profile

Other Wiki Sections

Software

PoweredBy

Running a PowerShell Script in Windows Task Scheduler

RSS
Modified on Fri, Jun 07, 2019, 7:15 AM by Administrator Categorized as PowerShell

Overview

This article gives details for successfully scheduling a PowerShell script to run within Windows Task Scheduler

Steps

General Tab

  • Select "Run only when the user is logged on" to test the script interactively
  • When testing is complete, choose the "Run whether user is logged on or not"
  • Select the "Run with highest privileges" checkbox

Triggers Tab

  • Schedule the task as you would any other

Actions

  • Program/Script: powershell.exe
  • Add arguments: -ExecutionPolicy Bypass -File "C:\path\to\my\script.ps1"
  • If your script has command line arguments, add them to the end of the Add arguments setting; for example: -ExecutionPolicy Bypass -File "C:\path\to\my\script.ps1" -Quiet

ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.