ANAVEM
Languagefr
Windows security monitoring dashboard showing Event Viewer with scheduled task creation events
Event ID 4702InformationSecurityWindows

Windows Event ID 4702 – Security: Scheduled Task Created

Event ID 4702 logs when a new scheduled task is created on Windows systems. This security audit event helps administrators track task creation for compliance and security monitoring purposes.

Emanuel DE ALMEIDAEmanuel DE ALMEIDA
18 March 202612 min read 0
Event ID 4702Security 5 methods 12 min
Event Reference

What This Event Means

Event ID 4702 represents a fundamental security audit event that Windows generates whenever the Task Scheduler service creates a new scheduled task. This event is part of Windows' comprehensive audit framework and provides administrators with detailed visibility into task creation activities across their environment.

The event captures extensive metadata including the security identifier (SID) of the user who created the task, the task name, the executable path, trigger conditions, and timing information. This granular detail makes Event ID 4702 particularly valuable for security operations centers (SOCs) and compliance teams who need to maintain detailed audit trails of system changes.

From a security perspective, scheduled tasks represent a common persistence mechanism used by both legitimate administrators and malicious actors. Attackers frequently create scheduled tasks to maintain access to compromised systems, execute malware at specific intervals, or perform privilege escalation. By monitoring Event ID 4702, security teams can quickly identify suspicious task creation patterns and investigate potential threats.

The event integrates seamlessly with Windows Event Forwarding (WEF) and SIEM solutions, enabling centralized monitoring across large environments. Modern security frameworks like MITRE ATT&CK specifically reference scheduled task abuse (T1053.005), making this event crucial for threat hunting and incident response activities in 2026's evolving threat landscape.

Applies to

Windows 10Windows 11Windows Server 2019/2022/2025
Analysis

Possible Causes

  • Administrator creating scheduled tasks through Task Scheduler GUI
  • PowerShell scripts using New-ScheduledTask or Register-ScheduledTask cmdlets
  • Command-line task creation using schtasks.exe
  • Third-party applications programmatically creating tasks via Task Scheduler API
  • Group Policy deploying scheduled tasks to domain computers
  • Windows Update or system maintenance creating automatic tasks
  • Malware establishing persistence through scheduled task creation
  • Software installations registering maintenance or update tasks
Resolution Methods

Troubleshooting Steps

01

Review Event Details in Event Viewer

Start by examining the specific Event ID 4702 entry to understand what task was created and by whom.

  1. Open Event Viewer by pressing Win + R, typing eventvwr.msc, and pressing Enter
  2. Navigate to Windows LogsSecurity
  3. Filter the log by clicking Filter Current Log in the Actions pane
  4. Enter 4702 in the Event IDs field and click OK
  5. Double-click the relevant event to view detailed information
  6. Review the following key fields in the event details:
    • Subject: Shows the user account that created the task
    • Task Name: The name assigned to the scheduled task
    • Task Content: XML configuration of the task including triggers and actions
Pro tip: The Task Content field contains the complete XML definition. Copy this to a text editor for easier analysis of complex task configurations.
02

Query Events with PowerShell

Use PowerShell to efficiently search and analyze Event ID 4702 occurrences across specific time periods.

  1. Open PowerShell as Administrator
  2. Query recent task creation events:
    Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4702} -MaxEvents 50 | Format-Table TimeCreated, Id, LevelDisplayName, Message -Wrap
  3. Filter events by specific user account:
    Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4702} | Where-Object {$_.Message -like "*DOMAIN\username*"}
  4. Export events to CSV for analysis:
    Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4702} | Select-Object TimeCreated, Id, LevelDisplayName, Message | Export-Csv -Path "C:\temp\TaskCreationEvents.csv" -NoTypeInformation
  5. Search for events within a specific date range:
    $StartTime = (Get-Date).AddDays(-7)
    $EndTime = Get-Date
    Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4702; StartTime=$StartTime; EndTime=$EndTime}
Warning: Large Security logs can impact performance. Use date filters and -MaxEvents parameter to limit results.
03

Correlate with Current Scheduled Tasks

Cross-reference Event ID 4702 entries with currently existing scheduled tasks to identify which tasks are still active.

  1. List all current scheduled tasks:
    Get-ScheduledTask | Select-Object TaskName, State, Author, Date | Sort-Object Date -Descending
  2. Get detailed information about a specific task mentioned in Event ID 4702:
    Get-ScheduledTask -TaskName "TaskNameFromEvent" | Get-ScheduledTaskInfo
  3. Export task definitions for comparison:
    Get-ScheduledTask | ForEach-Object { Export-ScheduledTask -TaskName $_.TaskName -TaskPath $_.TaskPath } | Out-File "C:\temp\AllTasks.xml"
  4. Check task execution history:
    Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-TaskScheduler/Operational'} -MaxEvents 100 | Where-Object {$_.Id -eq 200 -or $_.Id -eq 201}
  5. Identify tasks created by specific users:
    Get-ScheduledTask | Where-Object {$_.Author -like "*username*"} | Format-Table TaskName, Author, State
Pro tip: Compare the creation timestamp in Event ID 4702 with the Date field in Get-ScheduledTask to verify task persistence.
04

Analyze Task Content and Security Implications

Perform detailed analysis of the task configuration to assess security risks and compliance implications.

  1. Extract and analyze the XML task definition from Event ID 4702:
    $Event = Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4702} -MaxEvents 1
    $EventXML = [xml]$Event.ToXml()
    $TaskContent = $EventXML.Event.EventData.Data | Where-Object {$_.Name -eq 'TaskContent'} | Select-Object -ExpandProperty '#text'
    $TaskContent | Out-File "C:\temp\TaskDefinition.xml"
  2. Parse the XML to identify key security elements:
    [xml]$TaskXML = Get-Content "C:\temp\TaskDefinition.xml"
    $TaskXML.Task.Actions.Exec | Select-Object Command, Arguments
    $TaskXML.Task.Triggers | Select-Object *
    $TaskXML.Task.Principals.Principal | Select-Object UserId, RunLevel
  3. Check for suspicious characteristics:
    • Tasks running with SYSTEM privileges
    • Tasks executing from unusual locations (temp directories, user profiles)
    • Tasks with obfuscated command lines or encoded PowerShell
    • Tasks scheduled to run at unusual intervals
  4. Validate against organizational policies:
    # Check if task executable is in approved locations
    $ApprovedPaths = @("C:\Windows\System32", "C:\Program Files", "C:\Program Files (x86)")
    $TaskCommand = $TaskXML.Task.Actions.Exec.Command
    $IsApproved = $ApprovedPaths | Where-Object {$TaskCommand -like "$_*"}
  5. Document findings and create alerts for policy violations
Warning: Tasks running with elevated privileges from untrusted locations may indicate compromise. Investigate immediately.
05

Implement Continuous Monitoring and Alerting

Set up automated monitoring to detect and alert on suspicious scheduled task creation patterns.

  1. Create a PowerShell script for continuous monitoring:
    # TaskMonitor.ps1
    $LastCheck = (Get-Date).AddMinutes(-5)
    $SuspiciousEvents = Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4702; StartTime=$LastCheck} | Where-Object {
        $_.Message -like "*powershell*" -or 
        $_.Message -like "*cmd.exe*" -or
        $_.Message -like "*temp*" -or
        $_.Message -like "*SYSTEM*"
    }
    if ($SuspiciousEvents) {
        $SuspiciousEvents | Export-Csv "C:\logs\SuspiciousTasks.csv" -Append -NoTypeInformation
        # Send alert email or SIEM notification
    }
  2. Configure Windows Event Forwarding for centralized collection:
    • Enable WinRM on source computers: winrm quickconfig
    • Configure subscription on collector server
    • Create custom views for Event ID 4702 analysis
  3. Set up Event Viewer custom views:
    • Open Event ViewerCustom ViewsCreate Custom View
    • Filter by Event ID 4702 and save as "Scheduled Task Creation"
    • Configure email notifications for critical events
  4. Integrate with SIEM platforms:
    # Example: Forward to Splunk Universal Forwarder
    $LogPath = "C:\Program Files\SplunkUniversalForwarder\etc\apps\windows\local\inputs.conf"
    Add-Content -Path $LogPath -Value "[WinEventLog://Security]`nwhitelist = 4702`nindex = windows_security"
  5. Create baseline reports of legitimate task creation patterns for comparison
Pro tip: Establish baseline patterns during normal business hours to better identify anomalous task creation during off-hours or by unusual accounts.

Overview

Event ID 4702 fires whenever a new scheduled task is created on a Windows system through Task Scheduler, PowerShell, or programmatic interfaces. This security audit event appears in the Security log and provides detailed information about who created the task, when it was created, and the task's configuration details.

The event captures critical security information including the user account that created the task, the task name, and the executable or script being scheduled. This makes it invaluable for security monitoring, compliance auditing, and investigating potential malicious activity where attackers might use scheduled tasks for persistence.

Windows generates this event automatically when audit policy for "Audit Other Object Access Events" is enabled. The event includes rich metadata about the task creation, making it essential for environments that need to track administrative actions and maintain security baselines. Security teams rely on this event to detect unauthorized task creation and ensure only approved automation runs on their systems.

Frequently Asked Questions

What does Event ID 4702 mean and when does it appear?+
Event ID 4702 is a security audit event that logs whenever a new scheduled task is created on a Windows system. It appears in the Security log when the 'Audit Other Object Access Events' policy is enabled. The event captures detailed information about who created the task, when it was created, and the complete task configuration including triggers, actions, and security context. This event is essential for security monitoring as scheduled tasks are commonly used by both legitimate administrators and malicious actors for automation and persistence.
How can I tell if a scheduled task creation event is malicious?+
Several indicators can suggest malicious task creation: tasks running with SYSTEM privileges created by non-administrative users, executables located in temporary directories or user profiles, obfuscated command lines or encoded PowerShell scripts, tasks scheduled at unusual intervals or times, and tasks created by accounts that don't typically perform administrative functions. Additionally, tasks that execute immediately after creation or use living-off-the-land binaries like PowerShell, WScript, or RegSvr32 warrant investigation. Cross-reference the task creation time with other security events and verify the legitimacy of the creating user account.
Why am I not seeing Event ID 4702 in my Security log?+
Event ID 4702 only appears when the appropriate audit policy is enabled. You need to configure 'Audit Other Object Access Events' under Advanced Audit Policy Configuration. This can be done through Group Policy at Computer Configuration → Windows Settings → Security Settings → Advanced Audit Policy Configuration → Object Access → Audit Other Object Access Events. Set it to 'Success' to log successful task creations. On domain environments, ensure the policy is applied and that Group Policy has refreshed on target systems. Local systems can be configured using 'auditpol /set /subcategory:"Other Object Access Events" /success:enable'.
Can Event ID 4702 help with compliance requirements?+
Yes, Event ID 4702 is valuable for various compliance frameworks including SOX, HIPAA, PCI DSS, and ISO 27001 that require audit trails of system changes. The event provides detailed documentation of who created scheduled tasks, when they were created, and their complete configuration. This supports change management processes, privileged access monitoring, and security control validation. For compliance reporting, you can export these events to demonstrate that all scheduled task creation is logged and monitored. The event data includes timestamps, user accounts, and task details necessary for audit evidence and forensic analysis.
How should I respond to suspicious Event ID 4702 entries?+
When you identify suspicious task creation events, follow these steps: immediately review the task configuration and determine if it's still active using Get-ScheduledTask, analyze the executable path and arguments for malicious indicators, check if the creating user account has legitimate reasons for task creation, correlate with other security events around the same timeframe, and if the task appears malicious, disable it immediately using 'Disable-ScheduledTask' or 'schtasks /change /disable'. Document your findings, preserve evidence by exporting the event details and task XML, and consider reimaging the system if compromise is confirmed. Update your monitoring rules to detect similar patterns in the future.
Documentation

References (2)

Emanuel DE ALMEIDA
Written by

Emanuel DE ALMEIDA

Senior IT Journalist & Cloud Architect

Microsoft MCSA-certified Cloud Architect | Fortinet-focused. I modernize cloud, hybrid & on-prem infrastructure for reliability, security, performance and cost control - sharing field-tested ops & troubleshooting.

Discussion

Share your thoughts and insights

You must be logged in to comment.

Loading comments...