Skip to content
SOC Analyst Role
  • Loading index…

↑↓ navigate · ↵ open · Esc close

en

Security · Persistence

4698 · A scheduled task was created

Event 4698 is logged when a scheduled task is created, and it contains the full task XML including triggers, the run-as principal and the command to execute. Scheduled tasks are one of the most common persistence and remote execution techniques, used by malware loaders, ransomware operators and tools like Impacket's atexec. Reading the TaskContent is usually enough to decide if a task is malicious.

high prioritySecurity logPersistenceMITRE T1053.005

Where it is logged

Security log on the host where the task was registered (including remote creation via schtasks /s). Requires the Audit Other Object Access Events subcategory (Object Access) for Success. The TaskScheduler/Operational log (Event 106) is an alternative source.

Key fields to read

FieldWhat it tells you
TaskNameTask path and name, e.g. \Microsoft\Windows\UpdateCheck; attackers mimic Microsoft paths.
TaskContentFull task XML: look at <Exec><Command>, <Arguments>, triggers and <Principal>.
SubjectUserNameAccount that created the task.
SubjectLogonIdLogon ID to pivot to the 4624 (local vs remote creation).
ClientProcessIdPID of the process that registered the task (newer Windows builds).
RpcCallClientLocality0 for remote RPC creation, 1 for local, on newer builds.

Sample event

4698 — synthetic example
EventID: 4698
TimeCreated: 2026-03-14T02:31:12.904Z
Computer: NW-FIN-WS07.northwind.local
SubjectUserName: m.okafor
SubjectDomainName: NORTHWIND
SubjectLogonId: 0x2A41C7
TaskName: \Microsoft\Windows\OneDriveSync
TaskContent: <Task ...><Triggers><LogonTrigger><Enabled>true</Enabled></LogonTrigger></Triggers>
  <Principals><Principal id="Author"><UserId>S-1-5-18</UserId><RunLevel>HighestAvailable</RunLevel></Principal></Principals>
  <Actions Context="Author"><Exec><Command>C:\Users\m.okafor\AppData\Roaming\odsync.exe</Command>
  <Arguments>-k netsvc</Arguments></Exec></Actions></Task>
ClientProcessId: 6120
RpcCallClientLocality: 1

How to triage it

  1. 1Read the <Command> and <Arguments> in TaskContent: script interpreters, mshta, rundll32, encoded commands or binaries in AppData/Temp are red flags.
  2. 2Check the trigger and principal: logon or boot triggers and SYSTEM/HighestAvailable run levels indicate persistence with privilege.
  3. 3Compare TaskName against legitimate tasks; a task under \Microsoft\Windows\ created by a normal user is masquerading.
  4. 4Pivot on SubjectLogonId to the 4624: a type 3 logon from another host means remote creation (lateral movement).
  5. 5Hash and look up the referenced binary, check its creation time (Sysmon 11), and search for the same task name on other hosts.
  6. 6If malicious, delete the task, quarantine the binary and escalate to identify the initial access.

Benign vs suspicious

Usually benign

  • Software installers and updaters (browsers, Adobe, OneDrive) registering update tasks.
  • IT management tools and GPO-deployed scheduled tasks.
  • Users or admins creating maintenance tasks with schtasks or Task Scheduler.

Red flags

  • Actions running powershell -enc, cmd /c, mshta http..., regsvr32 /i:http or rundll32 with unusual DLLs.
  • Executables in AppData, Temp, ProgramData or C:\Users\Public.
  • Tasks created remotely (type 3 logon, RpcCallClientLocality 0), especially if deleted shortly after (Impacket atexec pattern).
  • Task names mimicking Microsoft tasks but created by user accounts, or running as SYSTEM from a non-admin creator.

Hunt for it: Splunk & KQL

Splunk SPL
index=wineventlog EventCode=4698
| rex field=Task_Content "<Command>(?<task_command>[^<]+)</Command>"
| rex field=Task_Content "<Arguments>(?<task_args>[^<]+)</Arguments>"
| search task_command="*AppData*" OR task_command="*Temp*" OR task_command="*powershell*" OR task_command="*mshta*" OR task_args="*-enc*"
| table _time, host, Account_Name, Task_Name, task_command, task_args
Sentinel KQL
SecurityEvent
| where TimeGenerated > ago(7d)
| where EventID == 4698
| extend TaskName = extract(@"<Data Name=\"TaskName\">([^<]*)<", 1, EventData)
| extend TaskCommand = extract(@"&lt;Command&gt;(.*?)&lt;/Command&gt;", 1, EventData)
| where TaskCommand has_any ("powershell", "mshta", "rundll32", "AppData", "Temp", "cmd.exe")
| project TimeGenerated, Computer, SubjectUserName, TaskName, TaskCommand

Field names depend on your add-on and table. More translations in the Splunk vs KQL cheat sheet.

Interview question

“An alert fires on Event 4698 on a finance workstation. Walk me through your triage.”

✓ Strong answer sketch

I start with the TaskContent XML, specifically the command, arguments, trigger and principal, because that tells me what will run, when and with what privilege. A logon-triggered task running a binary from AppData as SYSTEM under a fake \Microsoft\Windows name is classic persistence. Then I pivot on the subject logon ID to see whether the task was created locally or remotely over a type 3 logon, and I hash the referenced binary and check intel and prevalence across the fleet. If it is malicious I escalate, have the task removed and the host isolated, and trace back to how the binary got there.

More SOC interview questions

Frequently asked questions

What does Event ID 4698 mean?

Event ID 4698 means a scheduled task was created. The event includes the full task definition in TaskContent, including the command it runs, its triggers and the account it runs as.

Which audit policy enables Event ID 4698?

Audit Other Object Access Events under Object Access in the advanced audit policy. Without it, use the Microsoft-Windows-TaskScheduler/Operational log (Event 106 for task registration).