Idera nSoftware Compellent

PowerShell.com

PowerTip of the Day

Email my PowerTip:
Twitter my PowerTip:

Running PowerShell Scripts as Scheduled Task

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!

Copyright 2010 PowerShell.com. All rights reserved.