How to remove a domain from Office365

Share this:

In this Tutorial we are going over the process to a remove a production domain from Office365 using the web interface however the same results can be achieved using PowerShell.


A domain in Office365 is unique and in case you have registered a domain in a trial account and that account has expired you will have trouble trying to validate the same domain in a different account. The recommendation is always to remove your domain properly in case you are not using it (specially in case of Trial accounts).

For this Tutorial my test domain is and in the Office365 control panel I have just received the following message, so it is time to clean up and remove the domain since I want to use it afterwards.


The process is simple, the goal is to remove any object that is using this domain. We are going over several steps that you can use to check, and those steps will help you to remove a domain.

Step 01 – Disable the Active Directory synchronization…

The first step is to disable the Active Directory synchronization, and to do that we should click on users and groups and then click on Deactivate link on the Active Directory synchronization.


In the new page, click on Deactivate now to confirm the deactivation of the synchronization process. By doing that all objects that show as Synched with Active Directory will change their status to In cloud.


We will receive a message that the process may take up to 72 hours to complete, so before that time we can’t complain but usually it is way faster than 72 hours.


Step 02 – Removing the users…

All users that have the domain that we are about to remove must be removed as well. Our first step is to remove all the ones that have apatricio.infodomain on their properties.


An easy way to do that is creating a new view. Click on the Filter icon and then New View.


In the new page, let’s name this new filter as and we will select the domain from the list (, then click on save.


Select the new filter from the list and all accounts that have will be listed, select all of them and click on the icon remove.


A confirmation will be required, click on yes to confirm the deletion and we need to repeat this process until we don’t have any users being listed using the current filter.


Step 03 – Removing Groups…

The next step is to remove all gruoups that are using the domain that is about to be removed. Click on users and groups, and then security groups select all groups that are using that domain and click on Remove.


A confirmation will be required, click on yes to confirm.


Since we are working on the Groups, we can click on Manage Distribution Groups and inside of the Exchange Admin Center (EAC), let’s select all groups related to the domain that is about to be deleted and we will be removing those as well.

Step 04 – Removing the domain…

Now that we have removed all objects that were using the domain, we can click on domains, select the domain from the list and then click on Remove.


A dialog box will show up, click on Yes to confirm.


If the domain that we are removing is the default domain in Office365, we need to select a replacement and we can use the internal domain (the one that has and then click on continue.



In this Tutorial we demonstrated a few prerequisites that must be done before removing a domain in Office365.

Written by Anderson Patricio

Anderson Patricio is a Canadian Exchange Server MVP and MCSM (Solutions Master) and he contributes to the Microsoft Community with articles, tutorials, blog posts, forums and book reviews. He is a regular contributor at, and (Portuguese).