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
| Item | Details |
|---|---|
| Stage | Pre-Migration Entra leave |
| Progress | Around 45% |
| Device impact | MDM cleanup may already have run |
| Safe to retry | No |
| Responsibility | Customer 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 /leavefails 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
| Result | Meaning |
|---|---|
| Non-zero exit code from leave command | Join state or OS-level issue |
| Services stopped or disabled | Device management services issue |
| Command does not execute | Security 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
- Confirm the device shows
AzureAdJoined : NO - Re-open Opsole Migrate
- Start migration again
Do not retry repeatedly without confirming the device join state.
When to Contact Support
Contact support@opsole.com if:
dsregcmd /leavefails when executed manually- Device join state remains inconsistent after corrective actions
- Multiple devices show the same failure
Related Logs
- Event Viewer → Application and Services Logs → OpsoleMigrate
How is this guide?