---
title: "Monitor Windows Task Scheduler tasks"
url: "https://cronmissed.com/guides/windows-task-scheduler.md"
canonical_url: "https://cronmissed.com/guides/windows-task-scheduler"
last_updated: "2026-10-22"
type: "how-to"
summary: "A Windows scheduled task can stop firing when its user logs out, and a script failure is easy to miss. Ping CronMissed with PowerShell on success."
related: ["https://cronmissed.com/guides.md", "https://cronmissed.com/snippets/powershell.md", "https://cronmissed.com/guides/linux-crontab.md", "https://cronmissed.com/learn/exit-codes-and-failure-signals.md", "https://cronmissed.com/learn/choosing-grace-time.md"]
---

# Monitor Windows Task Scheduler tasks

> **For AI agents:** the complete index of CronMissed pages is [llms.txt](https://cronmissed.com/llms.txt). Every page is also served as markdown at its URL plus .md.

A Windows scheduled task can stop firing when its user logs out, and a script failure is easy to miss. Ping CronMissed with PowerShell on success.

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 $status
```

```schtasks
schtasks /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?

1. Run the task from Task Scheduler with "Run" and confirm the start and success pings.
2. Make the script exit 1 and confirm the check goes down with the status in the ping log.
3. 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.

## Questions

### Why does the script send $LASTEXITCODE?

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.

### Does the task need internet access at the moment it runs?

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.

## Sources

- [Microsoft Learn: schtasks create](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/schtasks-create), read 22 October 2026
- [Microsoft Learn: Task Scheduler for developers](https://learn.microsoft.com/en-us/windows/win32/taskschd/task-scheduler-start-page), read 22 October 2026

## Related pages

- [PowerShell](https://cronmissed.com/snippets/powershell.md)
- [Linux crontab](https://cronmissed.com/guides/linux-crontab.md)
- [Exit codes and failure signals](https://cronmissed.com/learn/exit-codes-and-failure-signals.md)
- [Choosing a grace time](https://cronmissed.com/learn/choosing-grace-time.md)

## Related

- [Monitor cron jobs on every platform: 24 guides](https://cronmissed.com/guides.md)
- [Ping CronMissed from PowerShell](https://cronmissed.com/snippets/powershell.md)
- [Monitor Linux crontab jobs with curl](https://cronmissed.com/guides/linux-crontab.md)
- [Exit codes and failure signals in cron jobs](https://cronmissed.com/learn/exit-codes-and-failure-signals.md)
- [How to choose a grace time for a cron check](https://cronmissed.com/learn/choosing-grace-time.md)
