How to Audit Every Scheduled Task on a Windows Server and Flag the Risky Ones
A scheduled task audit checks every task on a Windows machine for risk indicators: tasks running as SYSTEM with network actions, tasks pointing to executables that no longer exist on disk, tasks created by unknown authors, tasks with obfuscated SDDL permissions, and tasks running outside business hours.
If you manage Windows servers and you've never done a full task audit, you don't know what's scheduled to run on your machines. That's not an exaggeration — it's the default state of most environments.
Why scheduled tasks deserve an audit
Windows servers accumulate scheduled tasks over years. Software installations create them. Admins create them for maintenance scripts. Group Policy pushes them. Malware creates them for persistence. Previous admins who left the company created them for reasons nobody remembers.
The result is a server with 150-300 scheduled tasks, most of which nobody has reviewed since they were created. Some run as SYSTEM. Some point to scripts on network shares that no longer exist. Some were created by a contractor's domain account that was deactivated two years ago. Some run at 3am and nobody knows what they do.
This is technical debt with security implications. Every unreviewed scheduled task is a potential:
Persistence vector. Malware commonly creates scheduled tasks to survive reboots. A task running as SYSTEM that executes a binary from an unusual path is the textbook pattern — and it looks identical to a legitimate maintenance task unless you inspect it.
Stale configuration risk. A task that runs a script from \\fileserver\scripts\cleanup.ps1 works fine until someone decommissions that file server. Now the task fails silently every night, or worse, a different machine gets the same hostname and serves a different script.
Privilege escalation surface. A task running as SYSTEM that points to a writable path means anyone who can modify the executable at that path can execute code as SYSTEM. This is a common finding in penetration tests.
Compliance gap. Auditors ask "what scheduled automation runs on your production systems?" If your answer is "let me check Task Scheduler," you've already failed. The answer should be a document.
The manual audit approach (and why it doesn't scale)
Task Scheduler UI
Open Task Scheduler. Expand the Task Scheduler Library. Start clicking through tasks one at a time. For each task, check:
- What account it runs as (General tab → "When running the task, use the following user account")
- What it executes (Actions tab)
- What triggers it (Triggers tab)
- Whether the executable path actually exists on disk
- Who created it (General tab → Author, if populated)
- When it last ran and what the result was (History tab, if enabled)
On a server with 200 tasks, this takes 1-2 hours of clicking. There's no way to sort by run-as account. There's no way to filter for SYSTEM tasks. There's no export. At the end you have nothing to show for it except your memory of what you saw.
PowerShell enumeration
PowerShell can enumerate tasks programmatically:
Get-ScheduledTask | Get-ScheduledTaskInfo | Format-Table TaskName, LastRunTime, NextRunTime
This gives you a table of task names and run times. But it doesn't give you the run-as account, the actions, the triggers, or the author without additional scripting. The full task definition is available via Export-ScheduledTask, but the output is XML — one XML blob per task — that requires parsing to extract the fields you actually care about.
Building a PowerShell script that enumerates all tasks, extracts the relevant properties, applies risk logic, and outputs a clean CSV report is doable. It's also a half-day project, and the script you write will be specific to your environment and fragile against edge cases (tasks with multiple actions, tasks with SDDL strings, tasks with embedded credentials).
schtasks.exe
The native command-line option:
schtasks /query /fo CSV /v
This produces a CSV, which is better than XML. But the column headers vary by Windows version and locale, the quoting is inconsistent, and there's no risk analysis — just raw data. You still need to post-process it to answer questions like "which tasks run as SYSTEM?" or "which tasks point to executables that don't exist?"
What a proper task audit looks like
A production-grade scheduled task audit has four components:
1. Complete enumeration
Every task on the machine, with no exceptions. Not just the tasks visible in the top-level Task Scheduler Library — also the tasks nested in subfolders, the Microsoft system tasks, and the tasks hidden by SDDL restrictions that prevent non-admin users from seeing them. Run as administrator to ensure full visibility.
2. Property extraction
For every task, extract and normalize: task name, full path, enabled/disabled status, author, run-as account, last run time, last run result, next run time, all actions (executable path + arguments), all triggers (schedule, event, login, etc.), and the SDDL security descriptor.
3. Risk scoring
Evaluate every task against a set of risk indicators:
- SYSTEM + network action = CRITICAL. The highest risk pattern. A SYSTEM-level task that calls out to the internet or connects to a remote resource is either a very intentional administrative tool or malware. Either way, it needs human review.
- Missing executable = HIGH. If the task is configured to run a program that doesn't exist at the specified path, something changed and the task is either broken or was pointing to a temporary location that's been cleaned up.
- Unknown author = HIGH. Tasks created by authors that don't match Microsoft, the OS, or known software vendors get flagged. This catches tasks created by compromised accounts, departed employees, or manual attacker activity.
- Obfuscated SDDL = HIGH. SDDL strings that grant broad permissions or use unusual SID patterns may indicate an attempt to hide the task from inspection.
- Login trigger for all users = MEDIUM. Common for legitimate software, but also a persistence pattern. Flagged for context, not automatically suspicious.
- Recently disabled = MEDIUM. A task that was active within the last 30 days and is now disabled may indicate intentional disabling (fine) or an attacker covering tracks (not fine).
- Off-hours execution = MEDIUM. Tasks running between midnight and 5am are normal for maintenance windows but unusual for user-created tasks. Flagged for review.
4. Structured output
The results go into files, not a console window:
- A full inventory CSV with every task and every extracted property. This is the complete audit record — sortable, filterable, archivable.
- A risk report CSV with only the flagged tasks, sorted by severity. This is the action list — what needs human review, in priority order.
- A human-readable summary with totals: X tasks scanned, Y flagged as Critical, Z as High, etc. This is the executive overview.
- A machine-readable JSON with the full result for integration into monitoring, SIEM, or compliance systems.
How often to audit
Quarterly minimum for production servers. Scheduled task audits should be part of every quarterly security review cycle. The audit takes minutes; the output is documentation that proves the review was performed.
After any security incident. If a machine was compromised or a pen test found persistence, audit the tasks immediately. Compare against the last known-good audit to identify what's new.
During MSP client onboarding. Before you take responsibility for managing a client's infrastructure, document what's currently running. The task audit is baseline documentation — if something goes wrong later, you can prove what was already there when you started.
Before and after major changes. Server migrations, OS upgrades, software deployments — any change that might create, modify, or break scheduled tasks should have a before-and-after audit for comparison.
What to do next
If you've never audited the scheduled tasks on your Windows servers, you're relying on the assumption that every task was created legitimately and still does what it was intended to do. On a server that's been running for years, that assumption is almost certainly wrong.
Scheduled Task Auditor runs the full enumeration, risk scoring, and evidence pack generation in under a minute. The trial scans 50 tasks and shows the total count on the machine — enough to see the output format and risk scoring before you decide. Pro+ adds CLI and multi-machine scanning for auditing an entire environment from one workstation.
Run it on one server. If every task is clean and accounted for, you've got documentation proving it. If something doesn't look right, you just caught it before it became a problem.
Audit scheduled tasks with risk scoring
Flag SYSTEM tasks, missing executables, and suspicious authors. Evidence pack for compliance.