Home › Microsoft Defender for Endpoint › 0x8004FF2F

Microsoft Defender for Endpoint · 0x8004FF2F · Windows 11 23H2

MDE Onboarding Fails 0x8004FF2F ONBOARDING_NOT_COMPLETED Win11 23H2

Residual registry entries from previous AV products cause MDE onboarding failure; remove keys and re-run onboarding script.

Error Details

FactValueSourceNote
Exact error stringONBOARDING_NOT_COMPLETED (0x8004FF2F)MDEClientAnalyzer.cmd log->
Affected build rangeWindows 11 23H2OS Build
Registry key involvedHKLM\SYSTEM\CurrentControlSet\Services\SenseRegistry Editor->
Relevant service/endpoint URLhttps://api.securitycenter.microsoft.com/Network Trace
Log line signatureMDEClientAnalyzer.cmd: ONBOARDING_NOT_COMPLETED (0x8004FF2F)oboarding.log->

Log Files to Check

What This Error Actually Means

The error code 0x8004FF2F, which translates to "ONBOARDING_NOT_COMPLETED," is raised by Microsoft Defender for Endpoint (MDE) when the onboarding process fails due to residual registry entries from previous security products. The MDE sensor service, named SENSE, cannot complete its registration in active mode because it detects that the device was previously registered in passive mode with another endpoint protection product such as Symantec, McAfee, or CrowdStrike. This conflict prevents the new installation of Microsoft Defender for Endpoint from completing successfully.

Affected Versions and Scope

This error is specifically observed on Windows 11 devices running build 23H2. It affects domain-joined machines that are attempting to onboard MDE through Intune or SCCM configurations. The issue does not occur in other versions of Windows, nor does it affect non-domain joined systems or those without a history of passive mode registration with third-party security products.

Where To Look First: Logs and Event IDs

To diagnose this error, start by examining the following log files: In the oboarding.log, look for lines that contain the exact string "ONBOARDING_NOT_COMPLETED (0x8004FF2F)". Additionally, check the Security event log using Event Viewer or PowerShell to find Event ID 5176 and Event ID 4739. These events will provide context about the service startup failures related to the SENSE service.

Root Causes

Residual Registry Entries from Previous AV Products

When a device was previously registered in passive mode with another security product, residual registry entries may remain under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Sense. These entries prevent the MDE sensor service from completing its onboarding process.

Network Connectivity Issues to Microsoft's Security Center API

If the device cannot communicate with the endpoint URL https://api.securitycenter.microsoft.com/, the onboarding process will fail. This can be due to network policies, firewall rules, or DNS resolution issues preventing access to this specific API.

Distinguishing Between Root Causes

To differentiate between these causes, first review the registry for residual entries from previous AV products. If no such entries are found, investigate network connectivity by attempting a direct connection test to https://api.securitycenter.microsoft.com/.

Fix Procedure

  1. Delete any residual third-party AV sensor keys under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Sense. Use the Registry Editor or PowerShell cmdlet to remove these entries.

  2. Run the Microsoft Defender for Endpoint Onboarding troubleshooter script, located at C:\ProgramData\Microsoft\Windows Defender Advanced Threat Protection\Scripts\MDEClientAnalyzer.cmd.

  3. Use Intune or SCCM to re-run the onboarding process. In the Intune admin center, navigate to "Devices > Configuration profiles" and update the MDE configuration profile.

  4. Verify that the SENSE service is running correctly by executing Get-Service Sense. This command should return a status of 'Running' if the fix was successful.

Note: Be cautious when modifying registry keys, as incorrect changes can render devices unenrollable.
  • To ensure that no residual AV entries remain in passive mode, run Get-MgDeviceManagementManagedDevice -Filter "deviceEnrollmentType eq 'windowsAutoEnrollment'" | Where-Object { $_.ProductInfo.ProductName -eq 'Microsoft Defender for Endpoint' }. This will list all devices with MDE installed and check their enrollment status.

  • Error Code Variants

    CodeDescriptionDistinguishing Factors
    0x8004FF30ONBOARDING_FAILEDThis error occurs when the onboarding process fails due to network connectivity issues.
    0x8004FF2EONBOARDING_IN_PROGRESSDistinguishes from 0x8004FF2F as it indicates that another onboarding attempt is currently in progress.

    Verification

    To verify the fix, check for a successful log entry in C:\ProgramData\Microsoft\Windows Defender Advanced Threat Protection\Logs\oboarding.log. The line should read "ONBOARDING_SUCCESSFUL (0x0)". Additionally, confirm that the MDE sensor service is running and that the device appears correctly registered in the Microsoft 365 Defender portal under Devices > Device inventory.

    Prevention

    To prevent this issue from recurring, implement a baseline configuration change to ensure that all devices are wiped clean of any residual AV entries before onboarding MDE. This can be achieved through an OMA-URI setting in Intune such as .//Device/Vendor/MSFT/Security/Sense/ClearPassiveMode, which forces the removal of passive mode registration keys during device enrollment. Additionally, enforce a policy to run the MDE onboarding troubleshooter script periodically or upon major system updates. This proactive approach will help identify and resolve any lingering issues before they cause deployment failures.

    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.