Error Details
| Fact | Value | Source | Note |
|---|---|---|---|
| Exact error string | 0x87D1FDE8 | Intune admin center, Event Viewer | -> Device compliance |
| Affected OS build | Windows 11 23H2 | Device properties in Intune admin center | |
| Registry key involved | HKLM:\SOFTWARE\Microsoft\IntuneManagementExtension\SideCarPolicies\Scripts | Local device registry | -> Cached script version |
| Relevant service URL | https://localhost:58519/checkpoint | IME documentation | -> Force re-evaluation |
| Log line signature | 0x87D1FDE8, Remediation, Script | IntuneManagementExtension.log |
Log Files to Check
C:\ProgramData\Microsoft\IntuneManagementExtension\Logs\IntuneManagementExtension.logEvent Viewer > Applications and Services Logs > Microsoft > Windows > DeviceManagement-Enterprise-Diagnostics-Provider
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:C:\ProgramData\Microsoft\IntuneManagementExtension\Logs\IntuneManagementExtension.log- Look for lines containing '0x87D1FDE8', 'Remediation', and 'Script'.- Event Viewer > Applications and Services Logs > Microsoft > Windows > DeviceManagement-Enterprise-Diagnostics-Provider > Admin (specifically Event IDs 404 and 826).
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:- 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. - 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' - 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 - 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. - Test Remediation Script Manually: Copy the script to the device and run it as SYSTEM using PsExec64.exe -s -i powershell.exe.
- Correct Detection and Remediation Scripts: Ensure detection scripts exit 0 or 1, and remediation scripts exit 0 on success. Add error handling:
try {. Set $ErrorActionPreference = 'Stop' at the top.} catch { Write-Error $_.Exception.Message; exit 1 } - 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. - Restart IME Service and Force Re-evaluation: Restart-Service IntuneManagementExtension; Invoke-RestMethod -Uri 'https://localhost:58519/checkpoint'
Error Code Variants
| Error Code | Description |
|---|---|
| 0x87D1FDE8 | Remediation failed due to script execution issues. |
| 0x87D1FDDC | Policy evaluation failed, but this does not necessarily indicate a remediation failure. |
| 0x87D1FE24 | Remediation 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:C:\ProgramData\Microsoft\IntuneManagementExtension\Logs\IntuneManagementExtension.log- Ensure there are no more instances of '0x87D1FDE8', 'Remediation', or 'Script'.- Event Viewer > Applications and Services Logs > Microsoft > Windows > DeviceManagement-Enterprise-Diagnostics-Provider (check for Event ID 404).
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
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.Get-WinEvent -LogName 'Microsoft-Windows-DeviceManagement-Enterprise-Diagnostics-Provider/Admin' | Where-Object Id -eq 404 to filter out recent events related to remediation failures.