KB-022211

Domain Leave Failed

Troubleshooting when the device cannot be removed from the Active Directory domain during pre-migration (~50%–60%).

Description

During pre-migration, the application attempts to remove the device from the Active Directory domain.

The standard method uses configured domain credentials when connectivity to a domain controller is available. If this is not available, a forced offline removal is attempted.

This error occurs when both methods fail.

At this stage, earlier preparation steps may already have been completed, such as device management cleanup, SCCM removal, or Entra disconnect.


Quick Reference

ItemDetails
StagePre-Migration domain leave
ProgressAround 50% to 60%
Device impactDevice may be in a partial migration state
Safe to retryNo
ResponsibilityCustomer IT administrator

What You Will See

Application Message

Migration failed in module Remove-Computer

KB

Portal Log

Migration failed in module Remove-Computer

KB


Root Cause

The device is unable to leave the Active Directory domain.

Common causes:

  • Domain leave credentials are incorrect, expired, locked, or disabled
  • Domain leave account lacks permission to unjoin devices
  • Security policy or endpoint protection blocking execution
  • Broken or inconsistent domain trust state

Diagnosis

Run the following checks in PowerShell (Administrator):

Step 1 – Check domain join state
(Get-CimInstance Win32_ComputerSystem).PartOfDomain

Step 2 – Check configured domain name
Get-ItemPropertyValue "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -Name "Domain"

Step 3 – Check domain controller discovery
$domain = Get-ItemPropertyValue "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -Name "Domain"
Resolve-DnsName -Type SRV "_ldap._tcp.dc._msdcs.$domain"

ResultMeaning
Domain state is FalseDevice already left the domain
Domain controller lookup failsDNS or network issue
Domain reachable but leave failsCredential, permission, or trust issue

Resolution

Credential Issue

Update domain leave credentials in the Opsole Admin Portal with a valid account that has permission to unjoin computers.


Security Blocking

Allow domain removal operations and ensure endpoint security tools are not blocking the process.


Device Already Left Domain

Do not attempt to rejoin the domain without validation. Proceed based on the current device state.


Recovery Steps

This is a partial migration state. Do not retry repeatedly.

Customer IT must confirm:

  1. Current domain join state
  2. Whether Entra leave has completed
  3. Whether device management cleanup has completed
  4. Availability of local administrator access

After validation, rerun the migration.


When to Contact Support

Contact support@opsole.com if:

  • Domain leave fails even with valid credentials
  • Device state is unclear or inconsistent
  • Multiple devices show the same failure

  • Event Viewer → Application and Services Logs → OpsoleMigrate

How is this guide?