Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

"You cannot delete the default domain" error when you try to remove a domain from Office 365


PROBLEM

When you try to remove a domain from Microsoft Office 365 by using Windows PowerShell, you receive the following error message:
Remove-MsolDomain : You cannot delete the default domain. Use the Set-MsolDomain cmdlet to set another domain as the default domain before you delete this domain.
At line:1 char:18
+ Remove-MsolDomain <<<< -DomainName <DomainName>
+ CategoryInfo : OperationStopped: (:) [Remove-MsolDomain], MicrosoftOnlineException
+ FullyQualifiedErrorId : Microsoft.Online.Administration.Automation.DefaultDomainDeletionException,Microsoft.Online.Administration.Automation.RemoveDomain
This issue occurs if the domain is the primary or default domain.
This issue occurs if the domain is the primary or default domain.

↑ Back to the top


SOLUTION

Important If you have Office 365 for education, do not follow the steps in this procedure. Instead, contact Office 365 Support for help to resolve this issue.

↑ Back to the top


To resolve this issue, set the primary domain by editing the company profile. To do this, follow these steps:
  1. Sign in to the Office 365 portal (https://portal.office.com) as a global administrator.
  2. Click Admin. Then, if the Office 365 option is available, select this option.
  3. The name of your company is displayed near the top of the page. The name of your company acts as a link to your company's profile.

    Click the name of your company to see the profile.
  4. In the profile window, click Edit.
  5. In the Default domain box, change the domain, and then click OK.

↑ Back to the top


MORE INFORMATION

For more information, see the following Microsoft Knowledge Base article:
2284755 You get an error message when you try to remove a domain from Office 365

↑ Back to the top


Still need help? Go to Microsoft Community.

↑ Back to the top


Keywords: o365, yespartner, tsg, mop, o15, o365022013, o365p, o365a, o365m, vkbportal231, vkbportal237, vkbportal339, vkbportal343, kb, o365e

↑ Back to the top

Article Info
Article ID : 2787250
Revision : 5
Created on : 8/20/2020
Published on : 8/21/2020
Exists online : False
Views : 92