"Domain has associated subdomains" or "You cannot remove a domain that has subdomains" error when you try to remove a domain from Office 365

Article translations Article translations
Article ID: 2787792 - View products that this article applies to.

Not sure what release of Office 365 you're using? Go to the following Microsoft website:
Am I using Office 365 after the service upgrade?
Expand all | Collapse all

PROBLEM

If you try to remove a domain from Microsoft Office 365, you experience one or both of the following symptoms:
  • When you try to remove the domain through the Office 365 portal, you receive the following error message:
    Domain has associated subdomains.
  • When you try to remove the domain by using Windows PowerShell, you receive the following error message:
    Remove-MsolDomain : You cannot remove a domain that has subdomains. You must first delete the subdomains before you can remove this domain.
    At line:1 char:18
    + Remove-MsolDomain <<<< -DomainName <DomainName>
    + CategoryInfo : OperationStopped: (:) [Remove-MsolDomain], MicrosoftOnlineException
    + FullyQualifiedErrorId : Microsoft.Online.Administration.Automation.DomainHasChildDomainException,Microsoft.Online.Administration.Automation.RemoveDomain
This issue occurs if the domain has associated subdomains.

SOLUTION

To fix this issue, remove all subdomains that contain the domain that you're trying to delete.

For example, consider the following scenario:
  • You have two domains: www.contoso.com and contoso.com.
  • You want to remove the contoso.com domain.
In this scenario, you must also remove the http://www.contoso.com subdomain to remove the contoso.com domain.

MORE INFORMATION

For more info, see the following Microsoft Knowledge Base article:
2284755 You get an error message when you try to remove a domain from Office 365
Still need help? Go to the Office 365 Community website.

Properties

Article ID: 2787792 - Last Review: October 25, 2013 - Revision: 8.0
Applies to
  • Microsoft Office 365 for enterprises (pre-upgrade)
  • Microsoft Office 365 for small businesses  (pre-upgrade)
  • Microsoft Office 365 for education  (pre-upgrade)
  • Microsoft Office 365
Keywords: 
o365 o365022013 o365062011 o365e o365p o365a o365m pre-upgrade after upgrade KB2787792

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com