Forum Discussion
5even
Jul 08, 2024Copper Contributor
can not delete domain because of user references
Hi everyone, when I try to delete one of my domains in Entra/Azure, I receive following message In order to delete 'contoso.com` all resources that refer to it must be removed or renamed. If ...
- Jul 09, 2024So finally I could solve this problem with the help of you guys. I may forgot to mention, that I have a hybrid infrastructure. So all the users which were blocking the deletion hat an addition alias. Those were only showing up in Exchange Online Admin Center. I deleted the aliases on-prem and started manually a sync from Azure AD Connect. That was my solution. Thank you for the hints guys!
SPatkar_Blogs
Jul 08, 2024Copper Contributor
Check if any users or groups are having this custom domain.
Check if any deleted users are having this custom domain.
Check the domain of the GA account which you are logged in with. Ensure that the Global Administrator account is using the initial default domain name (.onmicrosoft.com) such as email address removed for privacy reasons. Sign in with a different Global Administrator account that such as email address removed for privacy reasons or another custom domain name like “fabrikam.com” where the account is email address removed for privacy reasons.
If domain deletion fails, ensure that you don’t have:
Apps configured on the domain name with the appIdentifierURI
Any mail-enabled group referencing the custom domain name
More than 1000 references to the domain name
The domain to be removed the set as the Primary domain of your organization
Also note that the ForceDelete option won't work if the domain uses Federated authentication type. In that case the users/groups on the domain must be renamed or removed using the on-premises Active Directory before reattempting the domain removal. If you find that any of the conditions haven’t been met, manually clean up the references, and try to delete the domain again.
https://learn.microsoft.com/en-us/powershell/module/azuread/remove-azureaddomain?view=azureadps-2.0
Try this powershell with -Force command.
- 5evenJul 09, 2024Copper ContributorMy GA is using the initial default domain. The problem azure shows me here are the several users. They have already the new primary domain assigned, but azure is telling me there are still linked to the old domain. I checked every single user but I cannot find any relation to the domain which I want to delete. no apps, no groups, no wrong domain in the properties..