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.

Solution


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 apatricio.info 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.

image2

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.

image8

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.

image11

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.

image14

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.

image17

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

image26

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

image23

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

image29

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.

image32

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.

image44

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

image47

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.

image35

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

image38

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 onmicrosoft.com) and then click on continue.

image41

Conclusion


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 ITPROCentral.com, MSExchange.org, Techgenix.com and Anderson Patricio.org (Portuguese).