Monitor Windows Task Scheduler tasks
On this page
A Windows scheduled task has the same blind spot as cron: Task Scheduler records a result code, but nobody is told when a task never starts, runs as a user who is logged out, or ends with an error. A PowerShell ping at the end of the script closes the gap.
How can a scheduled job fail silently on Windows Task Scheduler?
- A task registered to run only while its user is logged on does not run when that user is logged out. The schtasks /it option describes this case, and it has no effect on tasks that run as System.
- A minute schedule repeats forever unless you add an end time or a duration, and without /k an end time stops new runs but does not stop one that is already running.
- A script that fails inside PowerShell can still exit 0 unless the script sets an exit code, so Task Scheduler reports success for a job that did nothing.
- A machine that is asleep or off at the trigger time misses the run, and nothing reports that one was due.
What are the limits of Windows Task Scheduler?
| Limit | What the documentation says |
|---|---|
| Minute schedule | schtasks /sc minute takes /mo from 1 to 1439 minutes; the default is every minute. |
| Repetition interval | /ri sets the repetition in minutes, from 1 to 599940, and does not apply to MINUTE, HOURLY, ONSTART, ONLOGON, ONIDLE or ONEVENT schedules. |
| Run account | /ru takes a user or system. System is a highly privileged local account. |
| Interactive only | /it restricts the task to times when the run-as user is logged on. |
| Stopping a run | /k stops the program at the end time or duration of a minute or hourly schedule; without it a running program is left alone. |
How do you add a CronMissed ping to Windows Task Scheduler?
Register a task that runs a PowerShell script, and have the script ping at the end. The script below reports the start, runs the job, and sends the exit status. Run it with the account that owns the job, and prefer a task that runs whether or not the user is logged on.
# backup.ps1
$ping = "https://ping.cronmissed.com/5f0c1b2e-7a3d-4c8e-9b61-2d4f8a7e3c10"
try { Invoke-RestMethod -Uri "$ping/start" -TimeoutSec 10 | Out-Null } catch { }
& "C:\Tools\backup.exe"
$status = $LASTEXITCODE
try { Invoke-RestMethod -Uri "$ping/$status" -TimeoutSec 10 | Out-Null } catch { }
exit $statusschtasks /create /tn "Nightly backup" /sc daily /st 03:15 /ru SYSTEM /tr "powershell.exe -NoProfile -File C:\Tools\backup.ps1"Which check settings fit Windows Task Scheduler?
Create a cron check, or a simple check for a task that repeats every N minutes, in the time zone of the machine. Give it a grace that covers the run time and a startup delay, such as 10 minutes for a backup. For a laptop or a workstation that is not always on, use a longer period and a grace of an hour so a late start is not an alert.
How do you confirm the check works?
- Run the task from Task Scheduler with "Run" and confirm the start and success pings.
- Make the script exit 1 and confirm the check goes down with the status in the ping log.
- Log the user out (for a task set to interactive only) and confirm that the check goes late, which proves the pings really depend on the session.
Sources
- Microsoft Learn: schtasks create , read 22 October 2026
- Microsoft Learn: Task Scheduler for developers , read 22 October 2026
Questions and answers
- Because it is the exit status of the last native program. CronMissed treats 0 as success and any other number as a failure, so the check goes down whenever the backup tool reports an error.
- Yes, for the ping only. The ping uses HTTPS and a 10 second timeout. If the machine cannot reach CronMissed, no ping arrives, and the check goes late, which is the right result for a machine that cannot report.
Why does the script send $LASTEXITCODE?
Does the task need internet access at the moment it runs?
Create a check, add the ping to the job, and CronMissed alerts you the first time a run is late or reports a failure.
Start monitoring