Home › Microsoft Intune › 0x87D1FDE8

Microsoft Intune · 0x87D1FDE8 · Windows 11 23H2

Intune Error 0x87D1FDE8: Remediation Failed on Windows 11 23H2

Remediation script fails due to non-zero exit code or missing resource; fix by ensuring correct exit codes and paths.

Error Details

FactValueSourceNote
Exact error string0x87D1FDE8Intune admin center, Event Viewer-> Device compliance
Affected OS buildWindows 11 23H2Device properties in Intune admin center
Registry key involvedHKLM:\SOFTWARE\Microsoft\IntuneManagementExtension\SideCarPolicies\ScriptsLocal device registry-> Cached script version
Relevant service URLhttps://localhost:58519/checkpointIME documentation-> Force re-evaluation
Log line signature0x87D1FDE8, Remediation, ScriptIntuneManagementExtension.log

Log Files to Check

What This Error Actually Means

The error code 0x87D1FDE8 is raised by Microsoft Intune's Device Management component, specifically within the context of remediation scripts and compliance policies. It indicates that a remediation action attempted to correct a non-compliant state on an enrolled device but failed due to issues such as incorrect script execution, missing resources, or service interruptions. This error code is crucial for sysadmins as it highlights potential gaps in policy enforcement and can lead to security vulnerabilities if not addressed promptly.

Affected Versions and Scope

This issue affects Windows 11 devices running build 23H2 exclusively. The problem does not occur on earlier versions of Windows, such as Windows 10 or older builds of Windows 11. It is also important to note that this error is tenant-specific; it will appear only in environments where proactive remediation policies are actively being enforced by Intune administrators.

Where To Look First: Logs and Event IDs

To diagnose the root cause of the 0x87D1FDE8 error, you must first examine the logs on both the affected device and within the Microsoft Intune admin center. On the device itself, check the following log files: Additionally, you can use PowerShell cmdlets to retrieve relevant information: Get-WinEvent -LogName 'Microsoft-Windows-DeviceManagement-Enterprise-Diagnostics-Provider/Admin' | Where-Object Id -eq 404 | Select-Object TimeCreated,Message

Root Causes

The error code 0x87D1FDE8 can stem from several distinct issues:

Incorrect Script Execution Context

This occurs when the remediation script is configured to run under a different user context than required. For example, if the script needs to modify HKCU registry keys but is set to run as SYSTEM, it will fail and generate this error.

Misconfigured Detection or Remediation Scripts

If either the detection or remediation scripts exit with an unexpected code (other than 0 for success or 1 for failure), Intune will log this issue. Additionally, if the script references a resource that does not exist on the device, it will also fail.

Intune Management Extension Service Issues

The IME service must be running correctly for remediation actions to execute properly. If the service is stopped or crashes during execution, the action will fail and log this error code.

Fix Procedure

To resolve the 0x87D1FDE8 error, follow these steps:
  1. Review Script Output in Intune Admin Center: Navigate to Reports > Endpoint analytics > Proactive remediations > > Device status and check the Detection output and Remediation output columns for failing devices.
  2. Analyze IME Log on the Device: Use PowerShell to review the log file: Get-Content 'C:\ProgramData\Microsoft\IntuneManagementExtension\Logs\IntuneManagementExtension.log' | Select-String '0x87D1FDE8','Remediation','Script'
  3. Check Event Viewer for IME Events: Retrieve the last 10 relevant events: Get-WinEvent -LogName 'Microsoft-Windows-DeviceManagement-Enterprise-Diagnostics-Provider/Admin' | Where-Object Id -in (404,826) | Select-Object TimeCreated,Message
  4. Verify IME Service State: Check the status of the service: Get-Service -Name IntuneManagementExtension | Select-Object Status,StartType. If it is not running, restart with: Restart-Service IntuneManagementExtension.
  5. Test Remediation Script Manually: Copy the script to the device and run it as SYSTEM using PsExec64.exe -s -i powershell.exe.
  6. Correct Detection and Remediation Scripts: Ensure detection scripts exit 0 or 1, and remediation scripts exit 0 on success. Add error handling: try { } catch { Write-Error $_.Exception.Message; exit 1 }. Set $ErrorActionPreference = 'Stop' at the top.
  7. Adjust Run As Context: In Intune admin center > Endpoint analytics > Proactive remediations > > Properties, set 'Run this script using the logged-on credentials' to Yes if needed.
  8. Restart IME Service and Force Re-evaluation: Restart-Service IntuneManagementExtension; Invoke-RestMethod -Uri 'https://localhost:58519/checkpoint'

Error Code Variants

Error CodeDescription
0x87D1FDE8Remediation failed due to script execution issues.
0x87D1FDDCPolicy evaluation failed, but this does not necessarily indicate a remediation failure.
0x87D1FE24Remediation was skipped due to policy or device state conditions.

Verification

To verify that the fix has been successful, monitor the Intune admin center for updated status reports and check the logs on the affected devices. Look for:

Prevention

To prevent recurrence of the 0x87D1FDE8 error, ensure that all remediation scripts are thoroughly tested and validated before deployment. Implement a baseline policy that mandates regular testing of detection and remediation scripts to catch potential issues early.
Be cautious when manually restarting services or running scripts as SYSTEM; improper execution can lead to system instability.
A quick diagnostic trick is to use Get-WinEvent -LogName 'Microsoft-Windows-DeviceManagement-Enterprise-Diagnostics-Provider/Admin' | Where-Object Id -eq 404 to filter out recent events related to remediation failures.
This guide provides a comprehensive approach for troubleshooting and resolving the 0x87D1FDE8 error in Microsoft Intune, ensuring that your organization's device compliance policies are effective and reliable.

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.