Skip to main content
4698SecurityObject AccessSecurity tier 1

Event ID 4698: A scheduled task was created

Event ID 4698 records that a scheduled task was created, with the full task definition in TaskContent. Its siblings log a task being deleted (4699), enabled (4700) and updated (4702). Persistence usually shows up as a root-level task name, an Exec command in a user-writable folder, or a stored-password logon type.

What Triggers Event 4698, and Where 4699, 4700 and 4702 Fit

Event 4698 belongs to the Audit Other Object Access Events subcategory, which covers scheduled tasks, COM+ objects and indirect object access requests. Microsoft rates its volume as low and recommends Success auditing for domain controllers, member servers and workstations, citing the scheduled task events first. That makes this one of the cheaper audit settings to turn on everywhere. The event fires every time a new task is created, whether by schtasks.exe, the Task Scheduler console, a script, or an installer.

The fields are short. The Subject block names the requesting account and its SubjectLogonId. TaskName is written as \task_path\task_name, counted from the Task Scheduler Library node. TaskContent is the whole task definition as XML, which is where the analysis happens. Windows 10 1903 and later add five more fields: ClientProcessStartKey, ClientProcessId, ParentProcessId, RpcCallClientLocality and FQDN. The process fields name the client that asked the scheduler to create the task, which earlier builds never recorded, and the sample on this page includes them.

Read the XML in four places. Triggers say when the task runs: at logon, at boot, on a schedule. Principals say as whom: UserId, LogonType and RunLevel. Actions say what runs: an Exec element with a Command and Arguments. Settings can mark the task Hidden. Microsoft's guidance picks out two cheap checks. Alert when TaskContent contains LogonType Password, because the account password is then stored in Credential Manager in cleartext and an administrator can extract it. And look at tasks whose TaskName sits in the root of the library, written as \NAME, because tasks created manually or by malware often land there. Built-in tasks live in subfolders such as \Microsoft\Windows, so a root-level name that imitates a Windows component stands out.

Three identities appear in one record, and they do not have to match. The Subject is who asked the scheduler to create the task. Author in RegistrationInfo is what the task claims. UserId in the principal is the account it will run as. A standard user who creates a task that runs as a more privileged principal, or a task whose RunLevel is HighestAvailable, calls for review. Microsoft's two samples show the difference on a single line: the 4698 sample runs with LeastPrivilege and the 4702 sample with HighestAvailable.

The sample combines the flags. Account a.chen creates \WindowsUpdateCheck, a root-level name that borrows a Windows word, triggered at logon, running C:\ProgramData\Updates\winupd.exe -s, hidden, under a Password logon type. Any one of those could be innocent. Together they describe persistence (MITRE T1053.005, Scheduled Task), and MITRE also notes the scheduler can be abused for remote execution as part of lateral movement. When the creation is remote, the SubjectLogonId belongs to a network logon, so the 4624 for that ID gives you the source address.

The family sits on this page because the four events share a Subject block, a TaskName and a detection design. 4699 records a deleted task and includes the TaskContent of the task that no longer exists, so it doubles as a recovery of the definition. Microsoft notes the event does not happen often, and that deleting a task from the library root can be a sign of malicious activity. 4700 records a task being enabled, and its counterpart 4701, disabled, is listed on the same Microsoft subcategory page. Watch the pair for critical tasks that should never change state, and for dormant tasks that wake up weeks after creation. 4702 records an update and carries only TaskContentNew, the new definition. There is no old copy in the event, so you compare against the last 4698 or 4702 for the same TaskName.

That last point matters for rule design. A detection that only watches 4698 misses an attacker who edits an existing, trusted task and swaps its command. Microsoft applies the same LogonType Password check to updated tasks, and your Exec-path rule should run on 4702 as well as 4698.

Event 4698 Fields

FieldWhat it tells youSimulated value
SubjectUserSidSID of the account that created the task.S-1-5-21-424242-1133
SubjectUserNameName of the account that created the task.a.chen
SubjectDomainNameDomain or computer name of the account.CORP
SubjectLogonIdLogon session ID; correlates to the 4624 that opened the session.0x6b3f02
TaskNameTask path and name, counted from the Task Scheduler Library node.\WindowsUpdateCheck
TaskContentFull XML definition of the new task: triggers, principal, settings and actions.<?xml version="1.0" encoding="UTF-16"?><Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"><RegistrationInfo><Author>CORP\a.chen</Author></RegistrationInfo><Triggers><LogonTrigger><Enabled>true</Enabled></LogonTrigger></Triggers><Principals><Principal id="Author"><UserId>CORP\a.chen</UserId><LogonType>Password</LogonType><RunLevel>LeastPrivilege</RunLevel></Principal></Principals><Settings><MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy><Enabled>true</Enabled><Hidden>true</Hidden></Settings><Actions Context="Author"><Exec><Command>C:\ProgramData\Updates\winupd.exe</Command><Arguments>-s</Arguments></Exec></Actions></Task>
ClientProcessStartKeyStart key of the process that called the scheduler (added in Windows 10 1903 and later).5629499534213120
ClientProcessIdID of the process that called the scheduler (added in Windows 10 1903 and later).7216
ParentProcessIdID of the calling process's parent (added in Windows 10 1903 and later).4388
RpcCallClientLocalityLocality flag of the RPC caller (added in Windows 10 1903 and later); 0 in Microsoft's sample.0
FQDNName of the machine the call came from (added in Windows 10 1903 and later).WS-SIM-014.corp.socsimulator.example

Inspect Event 4698 Values

Click a field to inspect the full simulated value, the way you would expand it in a SIEM event view.

Example Event 4698 Log

A representative Security entry for Event 4698, generated deterministically by our telemetry engine so every field holds a realistic, internally consistent value.

Simulated example generated by SOCSimulator Research
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft-Windows-Security-Auditing" />
    <EventID>4698</EventID>
    <Version>0</Version>
    <Level>0</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x8020000000000000</Keywords>
    <TimeCreated SystemTime="2025-01-07T03:23:47.000Z" />
    <EventRecordID>723449</EventRecordID>
    <Channel>Security</Channel>
    <Computer>WS-SIM-001.corp.socsimulator.example</Computer>
    <Security />
  </System>
  <EventData>
    <Data Name="SubjectUserSid">S-1-5-21-424242-1133</Data>
    <Data Name="SubjectUserName">a.chen</Data>
    <Data Name="SubjectDomainName">CORP</Data>
    <Data Name="SubjectLogonId">0x6b3f02</Data>
    <Data Name="TaskName">\WindowsUpdateCheck</Data>
    <Data Name="TaskContent">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-16&quot;?&gt;&lt;Task version=&quot;1.2&quot; xmlns=&quot;http://schemas.microsoft.com/windows/2004/02/mit/task&quot;&gt;&lt;RegistrationInfo&gt;&lt;Author&gt;CORP\a.chen&lt;/Author&gt;&lt;/RegistrationInfo&gt;&lt;Triggers&gt;&lt;LogonTrigger&gt;&lt;Enabled&gt;true&lt;/Enabled&gt;&lt;/LogonTrigger&gt;&lt;/Triggers&gt;&lt;Principals&gt;&lt;Principal id=&quot;Author&quot;&gt;&lt;UserId&gt;CORP\a.chen&lt;/UserId&gt;&lt;LogonType&gt;Password&lt;/LogonType&gt;&lt;RunLevel&gt;LeastPrivilege&lt;/RunLevel&gt;&lt;/Principal&gt;&lt;/Principals&gt;&lt;Settings&gt;&lt;MultipleInstancesPolicy&gt;IgnoreNew&lt;/MultipleInstancesPolicy&gt;&lt;Enabled&gt;true&lt;/Enabled&gt;&lt;Hidden&gt;true&lt;/Hidden&gt;&lt;/Settings&gt;&lt;Actions Context=&quot;Author&quot;&gt;&lt;Exec&gt;&lt;Command&gt;C:\ProgramData\Updates\winupd.exe&lt;/Command&gt;&lt;Arguments&gt;-s&lt;/Arguments&gt;&lt;/Exec&gt;&lt;/Actions&gt;&lt;/Task&gt;</Data>
    <Data Name="ClientProcessStartKey">5629499534213120</Data>
    <Data Name="ClientProcessId">7216</Data>
    <Data Name="ParentProcessId">4388</Data>
    <Data Name="RpcCallClientLocality">0</Data>
    <Data Name="FQDN">WS-SIM-014.corp.socsimulator.example</Data>
  </EventData>
</Event>

Detecting Event 4698

Created or updated task that stores a password (LogonType Password)

Microsoft's own alert condition for 4698 and 4702. SPL assumes sourcetype XmlWinEventLog:Security. The KQL reads the task XML from EventData, where it is stored escaped, so the pattern accepts both forms of the angle bracket.

index=wineventlog sourcetype=XmlWinEventLog:Security (EventCode=4698 OR EventCode=4702)
| eval content=coalesce(TaskContent, TaskContentNew)
| where match(content, "<LogonType>Password</LogonType>")
| table _time, host, EventCode, SubjectUserName, SubjectLogonId, TaskName

Task created in the library root, outside the vendor folders

Microsoft points at names written as \NAME. Keep a lookup of known vendor tasks that legitimately sit in the root and exclude it. The Lucene filter is coarser: it only excludes the \Microsoft folder.

index=wineventlog sourcetype=XmlWinEventLog:Security EventCode=4698
| where match(TaskName, "^\\\\[^\\\\]+$")
| lookup known_root_tasks.csv TaskName OUTPUT allowed
| where isnull(allowed)
| table _time, host, SubjectUserName, SubjectLogonId, TaskName

Task whose Exec command runs from a user-writable folder

Run it on 4698 and 4702. The command is read out of the task XML, so it only works if your pipeline does not truncate TaskContent.

index=wineventlog sourcetype=XmlWinEventLog:Security (EventCode=4698 OR EventCode=4702)
| eval content=coalesce(TaskContent, TaskContentNew)
| rex field=content "<Command>(?<cmd>[^<]+)</Command>"
| where match(cmd, "(?i)\\\\(Users|ProgramData|Temp|AppData)\\\\")
| table _time, host, EventCode, SubjectUserName, TaskName, cmd

Task created and deleted within an hour (short-lived task)

Pairs 4698 with 4699 on host and TaskName. Short-lived tasks are a common way to run a payload once, for example during remote execution.

index=wineventlog sourcetype=XmlWinEventLog:Security (EventCode=4698 OR EventCode=4699)
| stats min(_time) as first, max(_time) as last, values(EventCode) as codes, values(SubjectUserName) as users by host, TaskName
| where mvcount(codes)=2 AND (last-first) < 3600

True Positive vs False Positive

Legitimate task creation is constant. Browser and Office updaters, backup agents, management tooling and Group Policy preferences all create tasks, usually with a vendor name in a vendor folder, and installers do it silently. The first baseline to build is TaskName plus the Exec command path plus the account, kept per host role. Once you know what a standard workstation creates, the leftovers are short.

The shapes worth a rule are specific. A root-level TaskName with a Windows-sounding name. An Exec command under Users, ProgramData, Temp or AppData. LogonType Password. A Hidden task triggered at logon or boot. A task that is created, run and deleted within the hour, which shows up as a 4698 and a 4699 with the same TaskName close together. An update to an old task that changes its command path. A creation under a remote logon, from a host that does not normally administer this one.

Pair the events by TaskName to read a task's life. A 4698 followed by a 4699 for the same name close together is what tooling built around remote task execution tends to leave behind, since the payload only needs the task for one run. A 4698 followed weeks later by a 4700 is a dormant task being activated. A 4702 with a different Exec path than the 4698 means someone edited a task that was already trusted. Each of those stories needs the events side by side, so index them on one TaskName field instead of leaving it buried in message text.

Triage starts with the definition. Read the Actions, then hash and check the signature of the binary. ClientProcessId and ParentProcessId in an event from Windows 10 1903 or later lead to the 4688 for the process that made the request, which tells you whether it was schtasks.exe, PowerShell or something custom, along with its command line. SubjectLogonId leads to the 4624 and the session type. Then check whether the binary ran after the trigger by looking for its 4688.

One practical limit: TaskContent is a long XML string, and some collectors and forwarders truncate event data. If your rule keys on text deep in the definition and your pipeline cuts it off, the Password and Exec checks will quietly miss. Compare the stored length of a long task in your SIEM with the original before you rely on them.

MITRE ATT&CK® Techniques

Event 4698 telemetry feeds detections for these ATT&CK® techniques:

Practice Investigating Event 4698

Reading about a scheduled task was created is one thing. Working the detection inside a live console is another. These free SOCSimulator operations cover the attack techniques Event 4698 helps you detect:

Start investigating free

Frequently Asked Questions

What is event ID 4698?
It records that a scheduled task was created. The event names the account that created it, the task path and name, and the full XML definition in TaskContent. It is written by the Audit Other Object Access Events subcategory when Success auditing is enabled.
What is the difference between events 4698, 4699, 4700 and 4702?
4698 is a task created, 4699 a task deleted, 4700 a task enabled and 4702 a task updated. They share the Subject and TaskName fields. 4699 and 4700 include TaskContent, while 4702 carries TaskContentNew, the new definition only. 4701, task disabled, completes the set.
How do I detect a malicious scheduled task with event 4698?
Alert on LogonType Password in TaskContent, on task names in the library root, and on Exec commands that run from user-writable folders. Run the same checks on 4702 for updated tasks. Microsoft recommends monitoring all task creation events, especially on critical computers.
Why is there no event 4698 in my Security log?
Success auditing for Audit Other Object Access Events has to be enabled on the machine that hosts the task. The subcategory is low volume, so Microsoft recommends enabling it for every computer type. Create a test task with schtasks and check for the event.

Sources

“4698 fields, TaskName format, five extra fields for Windows 10 1903 and later, root-node and LogonType Password recommendations”

“4699 task deleted: includes TaskContent, rarely occurs, deletion from the library root can indicate malicious activity”

“4702 task updated: carries TaskContentNew; LogonType Password check applies to updated tasks”

“Subcategory event list (4698 to 4702), low event volume, Success auditing recommended for all computer types”

“Scheduled Task (T1053.005): persistence and remote execution through the Windows Task Scheduler”

Event ID

Event ID 4656: Handle Requested, AccessMask & Failures

Event ID 4656 logs a request for a handle to a file or key. Decode the requested AccessMask, read Failure events and Pri…

Read more
Event ID

Event ID 4663: File Access, AccessMask and Detection Queries

Event ID 4663 shows an access right being used on a file or key. Decode AccessMask, fix 'not logging', and detect stagin…

Read more
Event ID

Event ID 4670: Permissions Changed, SDDL Diff and Detection

Event ID 4670 logs a permission change with the old and new SDDL. Diff OldSd and NewSd, catch Everyone full control, and…

Read more
Glossary

What is Data Exfiltration? SOC Glossary

Data exfiltration in cyber security is the unauthorized transfer of data from an organization's systems to infrastructur…

Read more
Glossary

What is Persistence? SOC Glossary

Persistence is the set of techniques an adversary uses to keep access to a compromised system after whatever gave them t…

Read more
Glossary

What is Threat Hunting? SOC Glossary

Threat hunting is the proactive search through security telemetry for attackers that existing controls missed. The hunte…

Read more
Career Path

SOC Analyst (Tier 2) Career Guide: Salary & Skills

Tier 2 SOC Analysts handle the investigations that Tier 1 escalates. You dig into multi-stage attacks, coordinate contai…

Read more
Career Path

Threat Hunter Career Guide: Salary & Skills

Threat Hunters do not wait for alerts. You develop hypotheses based on threat intelligence and adversary behavior models…

Read more
Technique

Scheduled Task/Job (T1053): Detection Training

Scheduled tasks give adversaries timed or recurring execution that survives reboots, making them a favorite for both exe…

Read more
Comparison

SOCSimulator vs. LetsDefend: Platform Comparison

SOCSimulator wins on operational realism. You get multi-tool shift simulation with SLA pressure, noise injection, and al…

Read more
Event ID

Windows Event ID Library: SOC Reference

Windows Security and Sysmon event IDs with simulated log samples, field tables, and tested detection queries.

Read more
Feature

Shift Mode: Real-Time SOC Simulation

Practice alert triage under realistic time pressure with SLA timers and noise injection.

Read more