de-DEen-GB
 
rss

Granikos Technology Blog

Remove a custom domain from Office 365

Den deutschsprachigen Post finden Sie hier: Löschung einer benutzerdefinierten Domäne in Office 365

 

A custom domain can only be registered once across all available Office 365 instances (Global, Germany, and China). In order for a registered domain to be used in a new tenant, the registered domain must be removed from the old tenant.

Note

The following text assumes that you have already migrated or backed up all user data. Otherwise, the steps described will result in the immediate deletion of data or a release for deletion within Office 365. If the domain to be deleted is the tenant's default domain, accounts for guest users (user_remotedomain#EXT#mydomain.com) stored in Azure AD also use that domain name. using that domain. These accounts must be removed as well.

 

Steps to delete a custom domain

Azure AD Connect

If the old tenant synchronizes with Azure AD Connect this configuration must be removed first. The domain to be deleted must not be used by any user or group object in Azure AD. Your options are:

  • The tenant should be deleted completely

    Move the synchronized objects (user accounts, groups) in the local Active Directory to organizational units that are not synchronized by Azure AD Connect. The removal of users in the Azure AD automatically deletes the data in the services formerly licensed to the user.
     
  • Only the domain should be removed

    If the domain is used as an UPN logon domain you must modify the UPN domain in the local Active Direcory for all affected users first. Update the UPN domain to a different domain already registered as custom domain in Office 365 and synchronize the changes to Azure AD. The CAN IT PRO-Team has published an excellent blog post on this topic. 

    If the domain is used for email services all proxy addresses using that domain name must be removed. The proxy addresses must be removed from objects in the on-premises Active Directory. Changes are synchronized to Azure AD by Azure AD Connect.

 

Office 365 

Use PowerShell to verify if there are still objects using the domain name to be deleted..

# Install the Office 365 PowerShell module
Install-Module MSOnline

# Import the module, if it's installed already
Import-Module MSOnline

# Connect to Office 365 using a global admin account w/o MFA
Connect-Msolservice

# domain name
$Domain = 'granikoslabs.de'
$Filter = "*@$Domain"

# List all Office 365 users with a UPN using the domain name
Get-MsolUser -DomainName $Domain | FL UserPrincipalName

# List all Office 365 users with a proxy address using the domain name
Get-MsolUser | Where-Object {$_.ProxyAddresses -like $Filter}

# List all Office 365 groups with a proxy address using the domain name
Get-MsolGroup | Where-Object {$_.ProxyAddresses -like $Filter}

# List all Office 365 groups with an email address using the domain name 
Get-MsolGroup | Where-Object {$_.EmailAddress -like $Filter} 

If you get any results from the list queries you must clean up the objects first. Without modifying the objects you cannot remove the custom domain from Office 365.

If the queries did not return any result you are safe to remove the custom domain from the old tenant.

# Domain removal
Remove-MsolDomain -DomainName $Domain -Force

After the final removal of the custom domain

After deleting the custom domain from the old tenant, the domain can be added to a new tenant relatively quickly in other Office 365 instances.

 

Link

 

Enjoy Office 365!



Kommentare sind geschlossen

Anzeigen 0 Kommentar