Scheduled Tasks
Cheat sheet · https://pcornel.dk/topic.php?topic=5668
Answer
Scheduled Tasks Automation manages Windows Task Scheduler definitions and execution while distinguishing task registration, principal/logon type, triggers/conditions, runtime invocation, result codes and downstream outcome.
Remember
- Task registered ≠ trigger conditions will fire.
- Manual Run success ≠ scheduled principal/environment success.
- Last Run Result success ≠ downstream workload outcome verified.
- Trigger fired ≠ action remained running or completed.
First checks
Get-ScheduledTask -TaskPath \Custom\— custom tasksRegister-ScheduledTask -TaskName <n> -Action $a -Trigger $t -Principal $p— createGet-ScheduledTaskInfo <n> | fl LastRunTime,LastTaskResult— result
Verify in this order
trigger → task → action → result
Where it usually breaks
Task Scheduler state proves scheduling/execution evidence only; it does not prove the action achieved its business or system outcome.
Trigger → queue accepted → worker lease/pickup → task running → terminal result → target mutation/read-back → effective runtime state → workload.
Scheduled Tasks automation proof-boundary map
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Scope / identity | Exact source revision, hosts and execution identity are explicit | Selector drift, stale inventory or wrong token changes scope/authority |
| Operation | Tool/provider action and per-host result are traceable | Partial failure, hidden error semantics or environment differences are lost |
| Platform state | Persistent and effective state are read back | Command/cmdlet success is mistaken for convergence |
| Workload proof | Original service/application acceptance passes | Automation summary substitutes for actual runtime behavior |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5668