โ† Help & Docs

Scheduled Runbook Execution & Drift Monitoring

Recurring script execution against device fleets or cloud tenants, with drift detection and action rules. Last updated 2026-05-14

What it does

The Ops Schedules page (under the Tasking nav group) lets you run library scripts on a recurrence - hourly, daily, weekly, or monthly. Each run is captured with full per-target output, and consecutive runs are compared for drift. When drift or failure is detected, configurable action rules fire email notifications or open Tasker tasks for follow-up.

Use cases

Script execution-target taxonomy ADO #498

Every library script is tagged with an executionTarget field that determines where and how it runs:

TargetIconWhere it runsRequires targets?
device๐Ÿ–ฅ๏ธDispatched to Windows hostnames via the TATER Agent's command-poll loopYes - one or more lowercase hostnames
cloudโ˜๏ธRuns against an M365/Entra tenant via Graph or EXO from a runbook or interactive admin sessionNo - leave targets empty
hybrid๐Ÿ”€Author opt-in for both modes (rare)Yes when used in device mode

Why this matters: a cloud script attempted via the device-execute path will fail at runtime - there's no agent to receive it. The scheduler enforces the contract at save time: cloud scripts cannot have device targets, device/hybrid scripts must have at least one. Existing scripts default to device (matches prior behavior).

Cloud auth context (optional companion)

Cloud scripts can additionally declare cloudAuthContext to document what auth the runbook host must provide. Values:

Creating a schedule

  1. Open TATER Ops โ†’ Tasking โ†’ Schedules and click + New Schedule.
  2. Pick a script. The dropdown shows the execution-target icon next to each script.
  3. For device/hybrid scripts: enter target hostnames (one per line, lowercase). Cloud scripts leave this empty.
  4. Set the recurrence - frequency, UTC time, and (where applicable) day of week / day of month.
  5. Add action rules. Trigger options: on-drift, on-failure, or always. Action options: email (with recipients) or tasker-task (with category + priority).
  6. Save. The cron checks every 5 minutes and runs schedules whose nextRunAt has passed.

How drift detection works

When a run completes, the scheduler queries the most recent previous run for the same schedule and compares normalized stdout per target. Any host whose stdout differs from the prior run is flagged. The run record stores:

When drift is found, run status rolls up to Drift (instead of Success) so it shows up amber in the runs list and triggers any on-drift action rules.

Drift detection precision

Phase 1 compares whitespace-normalized stdout text. Scripts that emit timestamps, GUIDs, or other always-changing data will appear to drift every run. Best practice: structure your script output so the stable signal (config values, group membership IDs, permission strings) is on its own lines, separated from the noisy metadata. Phase 2 will add JSON diff with per-property Before/After.

Action rules

Each schedule supports up to 20 action rules. They fire after a run finalizes, in order of trigger:

Email actions send via the configured notifications channel (Graph or SMTP). Tasker-task actions create a new task in TATER Ops under the supplied category and priority, with the run summary embedded in the task description and the originating schedule linked.

Recent runs & per-target output

The Recent Runs tab lists the last 50 runs across all schedules. Click any row to open the run detail modal, which shows:

Cloud script execution status ADO #497 Phase 1

Phase 1 ships the schema, scheduler, drift engine, and action rules end-to-end. Cloud scripts are scheduled and tracked but their actual execution path is Phase 2: today the scheduler records a Skipped run with the diagnostic "Cloud-execution channel not yet wired (Phase 2)" and advances nextRunAt so cron doesn't hot-loop. Phase 2 will wire Azure Automation runbook trigger + interactive admin handoff using cloudAuthContext to route. Device scripts run normally end-to-end today.

Permissions

Related