Running PowerShell Scripts as Scheduled Task

by Mar 9, 2010

If you have jobs that need to execute regularly, you can manage them with a PowerShell script and make it a scheduled task:

schtasks /CREATE /TN CheckHealthScript /TR "powershell.exe `
-noprofile -executionpolicy Unrestricted `
-file %public%\checkhealth.ps1" /IT /RL HIGHEST /SC DAILY

To remove the scheduled task, specify the name you assigned:

schtasks /DELETE /TN CheckHealthScript

Twitter This Tip! ReTweet this Tip!