KB-022210

Entra Leave Failed

Troubleshooting when the device cannot disconnect from an existing Entra ID join state during pre-migration (~45%).

Description

During pre-migration, the application detects if the device is already joined to Microsoft Entra ID and attempts to disconnect it.

This error occurs when the device fails to leave the existing Entra join state.

At this stage, certain preparation steps such as device management cleanup may already have been performed. No further migration steps will proceed until the join state is corrected.


Quick Reference

ItemDetails
StagePre-Migration Entra leave
ProgressAround 45%
Device impactMDM cleanup may already have run
Safe to retryNo
ResponsibilityCustomer IT administrator

What You Will See

Application Message

Migration failed in module dsregcmd

Portal Log

Migration failed in module dsregcmd


Root Cause

The device is unable to disconnect from its existing Entra ID join state.

Common causes:

  • dsregcmd /leave fails to execute successfully
  • Device management services are stopped or unhealthy
  • Security tools block execution of the command
  • The current Entra join state is inconsistent

Diagnosis

Run the following checks in PowerShell (Administrator):

Step 1 – Check current join state
dsregcmd /status

Step 2 – Attempt Entra leave manually
Start-Process "dsregcmd.exe" -ArgumentList "/leave" -Wait -PassThru | Select-Object ExitCode

Step 3 – Check device management services
Get-Service -Name "dmwappushsvc", "DeviceAssociationBrokerSvc" -ErrorAction SilentlyContinue | Select-Object Name, Status, StartType

ResultMeaning
Non-zero exit code from leave commandJoin state or OS-level issue
Services stopped or disabledDevice management services issue
Command does not executeSecurity or permission restriction

Resolution

Windows Service Issue

Restart the device and confirm required services are running.


Security Tool Blocking

Ensure dsregcmd.exe and the migration process are allowed by endpoint security tools.


Join State Issue

Customer IT should validate that the device can successfully leave the current Entra join state before retrying.


Recovery Steps

  1. Confirm the device shows AzureAdJoined : NO
  2. Re-open Opsole Migrate
  3. Start migration again

Do not retry repeatedly without confirming the device join state.


When to Contact Support

Contact support@opsole.com if:

  • dsregcmd /leave fails when executed manually
  • Device join state remains inconsistent after corrective actions
  • Multiple devices show the same failure

  • Event Viewer → Application and Services Logs → OpsoleMigrate

How is this guide?