Event ID 4702: scheduled task updated
What Event ID 4702 (scheduled task updated) means, the fields to check, what is normal and what is suspicious, with PowerShell and KQL queries to find it.
Event ID 4702 records a change to an existing scheduled task. Rather than creating a new task, an attacker can quietly change the action of a legitimate one, and 4702 is where that shows.
The fields that matter
| Field | What it tells you |
|---|---|
| Subject > Account Name | Who changed the task. |
| Task Name | Which task. |
| Task New Content | The updated XML: check the Exec command and arguments. |
What is normal
Updaters refreshing their own tasks, often daily.
When Event ID 4702 is suspicious
- A built-in or vendor task whose action now points to a script or a file in
AppData,TemporProgramData. - Changes by a user account to a task that runs as SYSTEM.
Common false positive: Browser, Office and driver updaters change their tasks frequently. Compare the new command with the vendor's usual path.
Find Event ID 4702 with PowerShell
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4702; StartTime=(Get-Date).AddDays(-7)} -MaxEvents 50 |
ForEach-Object {
$d = [ordered]@{ Time = $_.TimeCreated; Computer = $_.MachineName }
([xml]$_.ToXml()).Event.EventData.Data | ForEach-Object { $d[$_.Name] = $_.'#text' }
[pscustomobject]$d
} | Format-List
Microsoft Sentinel (KQL)
SecurityEvent
| where TimeGenerated > ago(7d) and EventID == 4702
| project TimeGenerated, Computer, Account, Activity, EventData
| order by TimeGenerated desc
Related events
- Event ID 4698: Scheduled task created
- Event ID 4699: Scheduled task deleted
- Event ID 4688: New process created
FAQ
Does 4702 show what changed?
It shows the new task XML. Compare it with the 4698 for the same task, or with the same task on a clean machine.
Windows Event Triage reads a CSV, EVTX-to-JSON or XML export in your browser and flags brute force, new admins, suspicious services and log clearing.
IOC Triage, our free browser extension: right-click it for a verdict from 15 threat-intel sources, then copy a ready ticket note.