Home › Microsoft Defender for Endpoint › 0x800700B7

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

MDE Onboarding Error 0x800700B7 Windows 11 23H2

Error occurs due to conflicting registry keys or services from previous attempts or other EDRs. Fix involves off-boarding, manual service removal, and re-onboarding.

Error Details

FactValueSourceNote
Exact error stringERROR_ALREADY_EXISTS: Cannot create a file when that file already existsEvent Viewer > Applications and Services Logs > Microsoft > Windows > SENSE > Operational (Event ID 5, 15, 28)
Affected OS build rangeWindows 11 23H2
Registry key involvedHKLM:\SYSTEM\CurrentControlSet\Services\SenseRegistry Editor
Relevant service/endpoint URLhttps://endpoints.microsoft.com/
Log line signatureEvent ID 5, 15, 28 in SENSE Operational logC:\Windows\System32\winevt\Logs\Microsoft-Windows-SENSE%4Operational.evtx

Log Files to Check

What This Error Actually Means

The error code 0x800700B7, which translates to "ERROR_ALREADY_EXISTS: Cannot create a file when that file already exists," is raised by Microsoft Defender for Endpoint (MDE) during the onboarding process. This issue occurs when MDE attempts to create registry keys or service entries but finds them already in place from either a previous partial installation attempt or due to conflicting security products. The error manifests as an inability to proceed with the onboarding because critical components cannot be uniquely created, leading to a failure in establishing proper communication and functionality between the endpoint and Microsoft's backend services.

Affected Versions and Scope

This specific issue is observed exclusively within Windows 11 build 23H2. It does not affect earlier versions of Windows or other builds of Windows 11. The error is particularly relevant for organizations that are rolling out MDE onboarding as part of their security strategy, especially those transitioning from older EDR solutions to Microsoft's offering. This problem does not occur in environments where the initial installation was successful without any interruptions or where no conflicting products were present.

Where To Look First: Logs and Event IDs

To diagnose this issue effectively, sysadmins should first consult the following logs: The exact log lines to look for are those with Event IDs 5, 15, and 28 in the Microsoft-Windows-SENSE/Operational log. These logs will provide detailed information about the onboarding process and any errors encountered during it.

Root Causes

The primary causes of this error can be categorized into a few distinct scenarios:

Prior Onboarding Inconsistencies

This occurs when an earlier attempt to onboard MDE was interrupted, leaving certain registry keys or service entries in an inconsistent state. To identify this cause, check the HKLM:\SOFTWARE\Microsoft\Windows Advanced Threat Protection for the OrgId registry value; if it matches a different tenant ID, it indicates that the device was previously onboarded to another environment.

Conflicting Security Products

Another common reason is the presence of other Endpoint Detection and Response (EDR) solutions such as CrowdStrike Falcon, Carbon Black, or SentinelOne. These products may create conflicting service entries in the system registry, preventing MDE from onboarding properly. To diagnose this issue, run Get-WmiObject -Class Win32_Product | Where-Object Name -match 'CrowdStrike|Carbon|Sentinel|ESET|Sophos|Symantec'.

Incomplete Removal of Previous EDR Agents

If a previous EDR agent was not fully removed before attempting to onboard MDE, remnants may still exist in the system registry or as services. This can be identified by checking for existing service entries related to these agents and verifying their removal.

Fix Procedure

To resolve this issue, follow these steps:
  1. Off-board the device from MDE: Navigate to https://security.microsoft.com/, go to Settings > Endpoints > Device management > Offboarding. Download and run the offboarding package for Windows 10/11 as an administrator.

  2. Re-onboard the device after off-boarding is complete: Use the same portal path to download and execute the onboarding script.

  3. If the above steps do not resolve the issue, manually remove the Sense service:

    • Stop the service using Stop-Service -Name Sense -Force.
    • Remove the registry key for the sense service: Remove-Item HKLM:\SYSTEM\CurrentControlSet\Services\Sense -Recurse -Force. Before proceeding, back up this registry entry by running reg export HKLM\SYSTEM\CurrentControlSet\Services\Sense C:\Sense_backup.reg.
    • After removal, re-run the onboarding script.
  4. If a conflicting EDR agent exists, uninstall it first. For CrowdStrike Falcon, use the CS Removal Tool (csclient.exe /uninstall) to remove it.

  5. Be cautious when removing security components from managed devices as this can disrupt device enrollment and management.
  6. For Intune-managed devices, utilize the MDE Security Settings Management policy in https://security.microsoft.com/. Navigate to Settings > Endpoints > Security settings management. This feature allows for re-onboarding without local script execution.

  7. To disable tamper protection on Intune-managed devices, navigate to Endpoint security > Antivirus > Windows Security Experience and set Tamper Protection to Off in the Intune admin center.

Error Code Variants

CodeDescription
0x800705B4ERROR_SERVICE_REQUEST_TIMEOUT: The service did not respond to the start or control request in a timely fashion.
0x800706BAERROR_NO_SYSTEM_RESOURCES: Insufficient system resources exist to complete the requested service.
0x80072EFDERROR_INVALID_STATE: The operation failed because the object's state is invalid for this operation.

Verification

To verify that the issue has been resolved, check the following:

Prevention

To prevent recurrence of this issue, ensure that: By adhering to these guidelines and procedures, organizations can minimize the occurrence of this error and ensure a smoother transition when adopting Microsoft Defender for Endpoint.

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.