Pcornel
Windows · Task Scheduler

Scheduled Tasks

Cheat sheet · https://pcornel.dk/topic.php?topic=3022

Back to the Topic

Answer

Scheduled tasks run actions automatically when triggered, as a chosen user or SYSTEM. Create them in Task Scheduler, with schtasks /create or Register-ScheduledTask.

Remember

  • Choose the account a task runs as.
  • Triggers decide when it runs.
  • Log the task's own output.

First checks

  • Get-ScheduledTask -TaskName <name> | fl * — task definition
  • Get-ScheduledTaskInfo -TaskName <name> — last run time and result
  • schtasks /query /tn <name> /v /fo list — details in CMD
  • Get-WinEvent -LogName Microsoft-Windows-TaskScheduler/Operational -MaxEvents 30 — task history (enable first)

Verify in this order

task registered → triggers, conditions, settings, principal, actions → runs

Where it usually breaks

First mismatch in definition/configuration → security context → service/task/process creation → runtime state → output/side effect → event/performance evidence; preserve identity/native error/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3022

Confirmation

Confirm action

Continue?