Error Details
| Fact | Value | Source | Note |
|---|---|---|---|
| Exact error string | 0x87D1FDE5 | Intune logs | ->IME timeout |
| Affected build range | Windows 11 22H2 | Microsoft documentation | |
| Registry key involved | HKLM\SOFTWARE\Policies\Microsoft\SystemCRL\IntuneTimeout | Registry Editor | ->IME timeout setting |
| Relevant service/endpoint URL | https://graph.microsoft.com/v1.0/deviceManagement/intents | Network trace | |
| Log line signature | IME PowerShell script execution timed out after 60 minutes | Windows Event Viewer |
Log Files to Check
C:\Windows\Logs\Intune\Intune.logC:\ProgramData\Microsoft\SystemCRL\logs\IntuneManagementExtension.log
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:C:\Windows\Logs\Intune\Intune.logC:\ProgramData\Microsoft\SystemCRL\logs\IntuneManagementExtension.log
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).
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:Identify the problematic scripts and review their logic for optimization opportunities.
Increase the timeout limit via registry modification:
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.New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\SystemCRL\IntuneTimeout" -Name "ScriptExecutionTimeoutMinutes" -Value 120 -PropertyType DWORDUse Intune's PowerShell cmdlets to manage scripts:
This command retrieves the specific script and updates its timeout setting through the Intune API.Get-MgDeviceManagementScript -Filter "name eq 'YourScriptName'" | Set-MgDeviceManagementScript -TimeoutInMinutes 120Optimize 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.
Error Code Variants
| Code | Description |
|---|---|
| 0x87D1FDE5 | IME PowerShell script execution timed out after 60 minutes. |
| 0x87D1FDE4 | IME encountered an unexpected error during PowerShell script execution. |
| 0x87D1FDDC | IME failed to start the PowerShell engine for script execution. |
Verification
To verify that your changes have resolved the issue:Check the Intune logs for successful script execution without timeouts:
Use Event Viewer to confirm no new 0x87D1FDE5 errors are logged.
Review device status in the Intune admin center under Devices > Overview. Ensure all devices reflect a healthy state with active management policies applied.
Prevention
To prevent recurrence of this issue, implement baseline changes such as:Create and enforce policy templates that limit script complexity and execution time.
Regularly review and optimize scripts to ensure they operate efficiently within the timeout constraints.
Monitor network performance and resource usage on devices to proactively address potential bottlenecks before they cause issues.