Idera nSoftware Compellent

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!


Posted Mar 09 2010, 08:00 AM by ps1

Comments

..::\\ www.christiano.ch //::.. » PowerShell: Running PowerShell Scripts as Scheduled Task wrote ..::\\ www.christiano.ch //::.. » PowerShell: Running PowerShell Scripts as Scheduled Task
on 03-10-2010 12:03 AM

Pingback from  ..::\\ www.christiano.ch //::.. » PowerShell: Running PowerShell Scripts as Scheduled Task

Running PowerShell Scripts as Scheduled Task – like Cronjobs for Windows!! « whileloop wrote Running PowerShell Scripts as Scheduled Task – like Cronjobs for Windows!! « whileloop
on 03-12-2010 10:05 PM

Pingback from  Running PowerShell Scripts as Scheduled Task – like Cronjobs for Windows!! « whileloop

Copyright 2010 PowerShell.com. All rights reserved.