Take over an unmanaged directory as administrator in Azure Active Directory
This article describes two ways to take over a DNS domain name in an unmanaged directory in Azure Active Directory (Azure AD), part of Microsoft Entra. When a self-service user signs up for a cloud service that uses Azure AD, they are added to an unmanaged Azure AD directory based on their email domain. For more about self-service or "viral" sign-up for a service, see What is self-service sign-up for Azure Active Directory?
Decide how you want to take over an unmanaged directory
During the process of admin takeover, you can prove ownership as described in Add a custom domain name to Azure AD. The next sections explain the admin experience in more detail, but here's a summary:
When you perform an "internal" admin takeover of an unmanaged Azure directory, you are added as the global administrator of the unmanaged directory. No users, domains, or service plans are migrated to any other directory you administer.
When you perform an "external" admin takeover of an unmanaged Azure directory, you add the DNS domain name of the unmanaged directory to your managed Azure directory. When you add the domain name, a mapping of users to resources is created in your managed Azure directory so that users can continue to access services without interruption.
Internal admin takeover
Some products that include SharePoint and OneDrive, such as Microsoft 365, do not support external takeover. If that is your scenario, or if you are an admin and want to take over an unmanaged or "shadow" Azure AD organization create by users who used self-service sign-up, you can do this with an internal admin takeover.
Create a user context in the unmanaged organization through signing up for Power BI. For convenience of example, these steps assume that path.
Open the Power BI site and select Start Free. Enter a user account that uses the domain name for the organization; for example,
email@example.com. After you enter in the verification code, check your email for the confirmation code.
In the confirmation email from Power BI, select Yes, that's me.
Sign in to the Microsoft 365 admin center with the Power BI user account. You receive a message that instructs you to Become the Admin of the domain name that was already verified in the unmanaged organization. select Yes, I want to be the admin.
Add the TXT record to prove that you own the domain name fourthcoffee.xyz at your domain name registrar. In this example, it is GoDaddy.com.
When the DNS TXT records are verified at your domain name registrar, you can manage the Azure AD organization.
When you complete the preceding steps, you are now the global administrator of the Fourth Coffee organization in Microsoft 365. To integrate the domain name with your other Azure services, you can remove it from Microsoft 365 and add it to a different managed organization in Azure.
Adding the domain name to a managed organization in Azure AD
Open the Microsoft 365 admin center.
Select Users tab, and create a new user account with a name like firstname.lastname@example.org that does not use the custom domain name.
Ensure that the new user account has global admin privileges for the Azure AD organization.
Open Domains tab in the Microsoft 365 admin center, select the domain name and select Remove.
If you have any users or groups in Microsoft 365 that reference the removed domain name, they must be renamed to the .onmicrosoft.com domain. If you force delete the domain name, all users are automatically renamed, in this example to email@example.com.
Sign in to the Azure AD admin center with an account that is the global admin for the Azure AD organization.
Select Custom domain names, then add the domain name. You'll have to enter the DNS TXT records to verify ownership of the domain name.
Any users of Power BI or Azure Rights Management service who have licenses assigned in the Microsoft 365 organization must save their dashboards if the domain name is removed. They must sign in with a user name like firstname.lastname@example.org rather than email@example.com.
External admin takeover
If you already manage an organization with Azure services or Microsoft 365, you cannot add a custom domain name if it is already verified in another Azure AD organization. However, from your managed organization in Azure AD you can take over an unmanaged organization as an external admin takeover. The general procedure follows the article Add a custom domain to Azure AD.
When you verify ownership of the domain name, Azure AD removes the domain name from the unmanaged organization and moves it to your existing organization. External admin takeover of an unmanaged directory requires the same DNS TXT validation process as internal admin takeover. The difference is that the following are also moved over with the domain name:
- License assignments
Support for external admin takeover
External admin takeover is supported by the following online services:
- Azure Rights Management
- Exchange Online
The supported service plans include:
- Power Apps Free
- Power Automate Free
- RMS for individuals
- Microsoft Stream
- Dynamics 365 free trial
External admin takeover is not supported for any service that has service plans that include SharePoint, OneDrive, or Skype For Business; for example, through an Office free subscription.
External admin takeover is not supported cross cloud boundaries (ex. Azure Commercial to Azure Government). In these scenarios it is recommended to perform External admin takeover into another Azure Commercial tenant, and then delete the domain from this tenant so you may verify successfully into the destination Azure Government tenant.
You can optionally use the ForceTakeover option for removing the domain name from the unmanaged organization and verifying it on the desired organization.
More information about RMS for individuals
For RMS for individuals, when the unmanaged organization is in the same region as the organization that you own, the automatically created Azure Information Protection organization key and default protection templates are additionally moved over with the domain name.
The key and templates are not moved over when the unmanaged organization is in a different region. For example, if the unmanaged organization is in Europe and the organization that you own is in North America.
Although RMS for individuals is designed to support Azure AD authentication to open protected content, it doesn't prevent users from also protecting content. If users did protect content with the RMS for individuals subscription, and the key and templates were not moved over, that content is not accessible after the domain takeover.
Azure AD PowerShell cmdlets for the ForceTakeover option
You can see these cmdlets used in PowerShell example.
||When prompted, sign in to your managed organization.|
||Shows your domain names associated with the current organization.|
||Adds the domain name to organization as Unverified (no DNS verification has been performed yet).|
||The domain name is now included in the list of domain names associated with your managed organization, but is listed as Unverified.|
||Provides the information to put into new DNS TXT record for the domain (MS=xxxxx). Verification might not happen immediately because it takes some time for the TXT record to propagate, so wait a few minutes before considering the -ForceTakeover option.|
||The domain list now shows the domain name as Verified.|
The unmanaged Azure AD organization is deleted 10 days after you exercise the external takeover force option.
Connect to Azure AD using the credentials that were used to respond to the self-service offering:
Install-Module -Name MSOnline $msolcred = get-credential connect-msolservice -credential $msolcred
Get a list of domains:
Run the Get-MsolDomainVerificationDns cmdlet to create a challenge:
Get-MsolDomainVerificationDns –DomainName *your_domain_name* –Mode DnsTxtRecord
Get-MsolDomainVerificationDns –DomainName contoso.com –Mode DnsTxtRecord
Copy the value (the challenge) that is returned from this command. For example:
In your public DNS namespace, create a DNS txt record that contains the value that you copied in the previous step. The name for this record is the name of the parent domain, so if you create this resource record by using the DNS role from Windows Server, leave the Record name blank and just paste the value into the Text box.
Run the Confirm-MsolDomain cmdlet to verify the challenge:
Confirm-MsolDomain –DomainName *your_domain_name* –ForceTakeover Force
Confirm-MsolDomain –DomainName contoso.com –ForceTakeover Force
A successful challenge returns you to the prompt without an error.
Submit and view feedback for