Step 2

If they stay, turn off directory sync

If a cycle runs and deletes nobody, the users are left behind as synced accounts nothing manages. Turning off directory sync for the tenant turns them into ordinary cloud accounts.

10 minutes, then hours of waitingOld tenant, Global Administrator

Confirm a cycle really ran

PowerShell
Connect-MgGraph -TenantId old.contoso.com -Scopes "Synchronization.Read.All","Application.Read.All" -NoWelcome
$sp = Get-MgServicePrincipal -Filter "displayName eq 'ad.contoso.com'"
Get-MgServicePrincipalSynchronizationJob -ServicePrincipalId $sp.Id |
  Select-Object TemplateId, @{n='Status';e={$_.Status.Code}},
    @{n='LastRun';e={$_.Status.LastExecution.TimeBegan}}, @{n='Result';e={$_.Status.LastExecution.State}}

If the jobs are Active with a recent successful run and the users are still there, carry on.

Disable the configuration

In Cloud sync › configuration › Properties, select Disable.

Turn off directory sync

PowerShell
Connect-MgGraph -TenantId old.contoso.com -Scopes "Organization.ReadWrite.All" -NoWelcome
$org = Get-MgOrganization
$org | Select-Object DisplayName, OnPremisesSyncEnabled    # check it is the OLD tenant
Invoke-MgGraphRequest -Method PATCH -Uri "https://graph.microsoft.com/v1.0/organization/$($org.Id)" `
  -Body @{ onPremisesSyncEnabled = $false }
This applies to the whole tenant

Nothing can sync into it until you turn sync back on, and Microsoft makes you wait 72 hours to do that. Use this only when the tenant should have no sync at all.

Wait for the conversion

Microsoft converts the accounts in the background. This can take a few hours; Microsoft allows up to 72.

PowerShell
Get-MgUser -Filter "onPremisesSyncEnabled eq true" -All -ConsistencyLevel eventual -CountVariable n | Out-Null; "$n still synced"

When it reaches 0, go to Delete and purge.

Your progress is kept in this browser only.