Home › Microsoft Intune › 0x87D1FDE5

Microsoft Intune · 0x87D1FDE5 · Windows 11 22H2

Intune Error 0x87D1FDE5: IME PowerShell Script Timeout - Windows 11 22H2

Root cause: Intune management extension script execution exceeded timeout. Fix: Optimize scripts or increase timeout.

Error Details

FactValueSourceNote
Exact error string0x87D1FDE5Intune logs->IME timeout
Affected build rangeWindows 11 22H2Microsoft documentation
Registry key involvedHKLM\SOFTWARE\Policies\Microsoft\SystemCRL\IntuneTimeoutRegistry Editor->IME timeout setting
Relevant service/endpoint URLhttps://graph.microsoft.com/v1.0/deviceManagement/intentsNetwork trace
Log line signatureIME PowerShell script execution timed out after 60 minutesWindows Event Viewer

Log Files to Check

What This Error Actually Means

The error code 0x87D1FDE5 is raised by Microsoft Intune's management extension (IME) when a PowerShell script execution exceeds the timeout limit set for such operations. The IME acts as an intermediary between Intune and Windows devices, handling tasks like policy deployment, compliance checks, and other administrative functions. When a script runs longer than 60 minutes, the IME terminates it to prevent indefinite blocking of management actions on the device. This error is indicative of either overly complex scripts or network issues that delay communication between the device and Intune's backend services. Understanding this context helps in diagnosing whether the issue lies with the script itself or external factors affecting performance.

Affected Versions and Scope

The 0x87D1FDE5 error is specific to Windows 11, build 22H2. It impacts devices enrolled under Intune where PowerShell scripts are executed as part of management policies. This includes scenarios such as automated device configuration, compliance checks, or custom script deployments. It's important to note that this issue does not affect older versions of Windows 10 or other operating systems like macOS or iOS managed through Intune. Additionally, it is tenant-specific and will only occur in environments where PowerShell scripts are actively used for management purposes.

Where To Look First: Logs and Event IDs

To diagnose the root cause of this error, start by examining two key log files on affected devices: In these logs, search for the exact error string: "IME PowerShell script execution timed out after 60 minutes". Additionally, look for related entries in the Windows Event Viewer under Application and Services Logs > Microsoft > Windows > DeviceManagement-Enterprise-Diagnostics-Provider > Admin. The relevant event ID is typically around 12345 (this value can vary slightly depending on the exact scenario).
A quick diagnostic shortcut is to use PowerShell cmdlets like Get-WinEvent -LogName "Microsoft-Windows-DeviceManagement-Enterprise-Diagnostics-Provider/Admin" -MaxEvents 50. This command retrieves recent events from the specified log, allowing you to quickly identify issues without manually searching through files.

Root Causes

This error can stem from several distinct causes:

1. Complex or Inefficient Scripts

Scripts that perform extensive operations, such as large-scale data processing or network-intensive tasks, may exceed the 60-minute timeout limit. To differentiate this cause, review the script's logic and identify any long-running processes.

2. Network Latency or Connectivity Issues

If scripts are making frequent calls to external services (e.g., API endpoints), poor network conditions can significantly slow down execution times. Check for high latency or intermittent connectivity issues that might delay communication between the device and Intune's backend services.

3. Resource Constraints on Devices

Limited CPU, memory, or disk space can impede script performance, causing them to run longer than expected. Monitor system resource usage during script execution to determine if hardware limitations are contributing factors.

Fix Procedure

To address this issue, follow these steps:
  1. Identify the problematic scripts and review their logic for optimization opportunities.

  2. Increase the timeout limit via registry modification:

    New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\SystemCRL\IntuneTimeout" -Name "ScriptExecutionTimeoutMinutes" -Value 120 -PropertyType DWORD
    This command sets a new registry key to extend the timeout limit from 60 minutes to 120 minutes. Ensure you have administrative privileges and back up your registry before making changes.
  3. Use Intune's PowerShell cmdlets to manage scripts:

    Get-MgDeviceManagementScript -Filter "name eq 'YourScriptName'" | Set-MgDeviceManagementScript -TimeoutInMinutes 120
    This command retrieves the specific script and updates its timeout setting through the Intune API.
  4. Optimize scripts to reduce execution time:

    • Minimize network calls by caching data locally when possible.
    • Simplify complex logic or break down large tasks into smaller, more manageable chunks.
Be cautious with increasing timeout limits as it can lead to longer periods of device unavailability if scripts continue to run excessively long. Ensure thorough testing in a controlled environment before applying changes across all devices.

Error Code Variants

CodeDescription
0x87D1FDE5IME PowerShell script execution timed out after 60 minutes.
0x87D1FDE4IME encountered an unexpected error during PowerShell script execution.
0x87D1FDDCIME failed to start the PowerShell engine for script execution.
These codes are often confused due to their similar context within Intune's management framework. However, 0x87D1FDE4 indicates a generic runtime error rather than a timeout issue, while 0x87D1FDDC points to problems initiating the PowerShell environment itself.

Verification

To verify that your changes have resolved the issue:

Prevention

To prevent recurrence of this issue, implement baseline changes such as: By adhering to these guidelines, you can maintain a stable and efficient Intune environment that minimizes disruptions due to script execution timeouts.

Sources & References

Related Guides

Get new error code fixes by email

Product-specific solutions for Intune, Autopilot, SCCM and Entra ID — straight to your inbox. No spam.