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.
Where it is logged
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
| Field | What it tells you |
|---|---|
| TaskName | Task path and name, e.g. \Microsoft\Windows\UpdateCheck; attackers mimic Microsoft paths. |
| TaskContent | Full task XML: look at <Exec><Command>, <Arguments>, triggers and <Principal>. |
| SubjectUserName | Account that created the task. |
| SubjectLogonId | Logon ID to pivot to the 4624 (local vs remote creation). |
| ClientProcessId | PID of the process that registered the task (newer Windows builds). |
| RpcCallClientLocality | 0 for remote RPC creation, 1 for local, on newer builds. |
Sample event
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: 1How to triage it
- 1Read the
<Command>and<Arguments>inTaskContent: script interpreters,mshta,rundll32, encoded commands or binaries inAppData/Tempare red flags. - 2Check the trigger and principal: logon or boot triggers and
SYSTEM/HighestAvailablerun levels indicate persistence with privilege. - 3Compare
TaskNameagainst legitimate tasks; a task under\Microsoft\Windows\created by a normal user is masquerading. - 4Pivot on
SubjectLogonIdto the 4624: a type 3 logon from another host means remote creation (lateral movement). - 5Hash and look up the referenced binary, check its creation time (Sysmon 11), and search for the same task name on other hosts.
- 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
schtasksor Task Scheduler.
Red flags
- Actions running
powershell -enc,cmd /c,mshta http...,regsvr32 /i:httporrundll32with unusual DLLs. - Executables in
AppData,Temp,ProgramDataorC:\Users\Public. - Tasks created remotely (type 3 logon,
RpcCallClientLocality0), especially if deleted shortly after (Impacketatexecpattern). - Task names mimicking Microsoft tasks but created by user accounts, or running as
SYSTEMfrom a non-admin creator.
Hunt for it: Splunk & KQL
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_argsSecurityEvent
| where TimeGenerated > ago(7d)
| where EventID == 4698
| extend TaskName = extract(@"<Data Name=\"TaskName\">([^<]*)<", 1, EventData)
| extend TaskCommand = extract(@"<Command>(.*?)</Command>", 1, EventData)
| where TaskCommand has_any ("powershell", "mshta", "rundll32", "AppData", "Temp", "cmd.exe")
| project TimeGenerated, Computer, SubjectUserName, TaskName, TaskCommandField 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.
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).