November 23rd, 2013

PowerTip: Find Missed Runs on Scheduled Task or Job

Doctor Scripto
Scripter

Summary: Use Windows PowerShell to find the number of missed runs on a scheduled task or scheduled job.

Hey, Scripting Guy! Question How can I use Windows PowerShell to find the number of missed runs on a scheduled task or scheduled job?

 Hey, Scripting Guy! Answer Use the scheduled task cmdlets:

PS C:> Get-ScheduledTask -TaskName MyScheduledJob | Get-ScheduledTaskInfo

 

LastRunTime        : 10/16/2013 10:20:20 AM

LastTaskResult     : 0

NextRunTime        : 10/17/2013 10:20:20 AM

NumberOfMissedRuns : 0

TaskName           : MyScheduledJob

TaskPath           : MicrosoftWindowsPowerShellScheduledJobs

PSComputerName     :

 

PS C:> (Get-ScheduledTask -TaskName MyScheduledJob | Get-ScheduledTaskInfo).NumberOfMissedRuns

0

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.