The "Remove" link is unavailable when removing a domain from Microsoft 365

PROBLEM

When you try to remove a domain from Microsoft 365, you experience one of the following symptoms:

  • The Remove link is unavailable.

  • When you try to remove the domain by using Windows PowerShell, you receive the following error message:

    Remove-MsolDomain : You cannot remove the initial domain created for you in Office 365.
    At line:1 char:18
    + Remove-MsolDomain <<<< -DomainName <DomainName>
    + CategoryInfo : OperationStopped: (:) [Remove-MsolDomain], MicrosoftOnlineException
    + FullyQualifiedErrorId : Microsoft.Online.Administration.Automation.InitialDomainDeletionException,Microsoft.Online.Administration.Automation.RemoveDomain
    

Note

Azure AD and MSOnline PowerShell modules are deprecated as of March 30, 2024. To learn more, read the deprecation update. After this date, support for these modules are limited to migration assistance to Microsoft Graph PowerShell SDK and security fixes. The deprecated modules will continue to function through March, 30 2025.

We recommend migrating to Microsoft Graph PowerShell to interact with Microsoft Entra ID (formerly Azure AD). For common migration questions, refer to the Migration FAQ. Note: Versions 1.0.x of MSOnline may experience disruption after June 30, 2024.

CAUSE

This issue occurs if the domain is the Microsoft Online routing domain. The Microsoft Online routing domain is the domain that's issued to you by Microsoft 365 (for example, contoso.onmicrosoft.com). This domain can't be deleted. Therefore, the Remove link is unavailable.

MORE INFORMATION

For more information, see You get an error message when you try to remove a domain from Microsoft 365.

Still need help? Go to Microsoft Community.