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

Anderson Patricio is a Canadian MVP in Cloud and Datacenter Management, and Office Server and Services, besides the Microsoft Award he also holds a Solutions Master (MCSM) in Exchange and several other certifications. Anderson has been contributing to the Microsoft Community with articles, tutorials, blog posts, twitter, forums and book reviews. He is a regular contributor here at,, and Anderson (Portuguese).

Related Post

Creating a new Azure Active Directory instance It seems a simple thing, but when you need to create an additional directory for testing/dev purposes, you may ask yourself how to create. In this Tut...
How to assign a public name to your Microsoft Azur... How to assign a public name to your website hosted at Microsoft Azure. Solution In order to assign a public name to a Microsoft Azure website,...
Managing the Password Synchronization in DirSync In this Tutorial we will check how to manage the Password Synchronization feature in the Windows Azure Active Directory Synchronization Tool. Solution...
How to force the Synchronization using AADSync How to force the synchronization using AADSync. When using DirSync tool there is a PowerShell cmdlet to perform such task, however using the AADSync t...