Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

Scheduled Tasks

Direct 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.

When to use this

Use it when designing, operating or troubleshooting Windows Automation behavior around Scheduled Tasks. Keep target scope, execution context, operation result, platform read-back and workload acceptance as separate proof boundaries.

First 30 seconds

1. Task Scheduler runs scheduled automation.

2. Run as gMSA (Principal with LogonType Password via gMSA).

3. Log outputs.

4. Check LastTaskResult (0 = success).

5. Manage tasks via code.

Operational verification

trigger → task → action → result

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Windows and PowerShell automation
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformWindows and PowerShell automation · Windows Automation → Scheduled Tasks owns Windows scheduling automation; generic scheduled automation and application job behavior remain separate.
Scope / prerequisiteUse it when designing, operating or troubleshooting Windows Automation behavior around Scheduled Tasks. Keep target sco…
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

5 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Operational evidence path Verify boundary

task intent/XML → registration → principal/logon rights → trigger/conditions → action invocation → task/process result → downstream state → next-run verification

Healthy evidence: task definition/principal/conditions are explicit, real scheduled execution is observable and downstream results verify.

Step 2 Verification path Verify boundary

When testing Scheduled Tasks, include the cases that usually go wrong: wrong computer/session, double-hop/auth issues, module drift, non-terminating errors, registry/task ambiguity, reboot/pending state and treating command completion as target convergence.

Step 3 Failure modes and next checks Narrow the fault

Suspicious evidence: manual execution passes but the scheduled identity, working directory, condition or credential context fails silently.

Step 4 Branching troubleshooting Narrow the fault

Concrete boundaries: trigger → queue accepted → worker lease/pickup → task running → terminal result → target mutation/read-back → effective runtime state → workload.

Step 5 Where it fails Narrow the fault

Where Scheduled Tasks usually goes wrong: module/action identity, args, delegation/privilege, changed/failed semantics and target read-back.

Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • 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.
Key checks
  • Get-ScheduledTask -TaskPath \Custom\ — custom tasks
  • Register-ScheduledTask -TaskName <n> -Action $a -Trigger $t -Principal $p — create
  • Get-ScheduledTaskInfo <n> | fl LastRunTime,LastTaskResult — result
ReferenceWhat it is1 section · depth on demand

Core model

Trace desired task XML/settings and principal through registration, trigger/condition eligibility, Task Scheduler invocation, process/result evidence and the artifact/state the task should produce.

ReferenceWhy it matters1 section · depth on demand

Common mistakes

  • Tasks running as users who change passwords.
ReferenceImportant terms & boundaries2 sections · depth on demand

What this shows and what it does not

Task Scheduler state shows scheduling/execution evidence only, but it does not show the action achieved its business or system outcome.

Close with Follow one job ID through queue and worker, verify exactly-once/idempotent target outcome, read effective state and run the original workload after terminal completion. and state what the evidence does not show.

In depth

Scheduled Tasks run Windows automation on a schedule or trigger (logon, startup, event) under a chosen account. They can be created with PowerShell, Group Policy or Intune.

$action  = New-ScheduledTaskAction -Execute 'pwsh.exe' -Argument '-NoProfile -File C:\Scripts\Cleanup.ps1'
$trigger = New-ScheduledTaskTrigger -Daily -At 02:30
$principal = New-ScheduledTaskPrincipal -UserId 'CORP\svc-cleanup$' -LogonType Password   # gMSA
Register-ScheduledTask -TaskName 'Cleanup' -Action $action -Trigger $trigger -Principal $principal
SettingRecommendation
AccountgMSA or SYSTEM, not a personal account
"Run whether user is logged on or not"Required for unattended jobs
Result monitoringCheck LastTaskResult, alert on non-zero
Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docWindows and PowerShell automation current

Authoritative/upstream documentation reviewed for bounded claims in Windows Automation > Scheduled Tasks. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://learn.microsoft.com/en-us/powershell/ · confidence 94%
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
scheduled task automationwindows task scheduler automationschtasks automation
Embedded reference data

Quick lookup tables

Scheduled Tasks automation proof-boundary map

Fast scope, execution, platform-state and workload-acceptance boundaries for Scheduled Tasks.

BoundaryHealthy evidenceSuspicious evidence
Scope / identityExact source revision, hosts and execution identity are explicitSelector drift, stale inventory or wrong token changes scope/authority
OperationTool/provider action and per-host result are traceablePartial failure, hidden error semantics or environment differences are lost
Platform statePersistent and effective state are read backCommand/cmdlet success is mistaken for convergence
Workload proofOriginal service/application acceptance passesAutomation summary substitutes for actual runtime behavior
Depth when you need it

Deep reference

Healthy vs suspicious evidence

Output interpretation

For Scheduled Tasks, rely on structured fields and stable IDs (module/action identity, args, delegation/privilege, changed/failed semantics and target read-back) rather than text formatted for display.

Confirmation

Confirm action

Continue?