I am trying to delete a custom domain name, example.com, from my Azure directory, but getting an error about not being able to do so, when signed in as user that has 'example.com' in the user name. But if I try to create a new user, I get an error unless the username ends with @mycompanyname.com.

So how can I ever create a user that does not include 'example.com' in the user name?

It sounds like the domain in question is set as the default domain. If so, you'll need to set another domain as the default. If you have no other custom domain to set as the default then you can set the onmicrosoft.com domain as the default.

  • Thanks for the suggestion. And yes, the domain was actually the default to domain to start with, but fortunately that was easy to change back to usernameexample.onmicrosoft.com. – Jan Aagaard Dec 6 at 19:04
up vote 2 down vote accepted

Figured it out: I was allowed to create a user with @usernamemycompanyname.onmicrosoft.com as the domain name. That user doesn't have mycompanyname.com as part of the username.

I guess this is pretty obvious once you realize that the special onmicrosoft.com subdomain is created for you by default. I would have liked get a reminder about that in the error message or next the input field where you create new users.

(I still can't delete the domain name, though. Now I get an ObjectPendingTakeover error. I have created another question to solve that issue.)

Deleting domain is not as easy as it looks.

As you have figured out you should not be logon with a user that is part of that domain As @joewerty mentioned the domain must not be the default domain Bottom line, domain shouldn't be in use, nothing should lock the domain.

https://docs.microsoft.com/en-us/azure/active-directory/users-groups-roles/domains-manage#delete-a-custom-domain-name

Hope this helps with this question and the other question.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.