Azure-Active Directory

Can’t delete a directory through the Azure Management Portal

This article will assist you in resolving an issue in which you are unable to delete a directory from the Azure Active Directory extension in the Azure portal.

Symptoms

You can’t delete a directory from the Microsoft Azure Active Directory extension through the Azure Management Portal. Additionally, you receive one of the following messages:

  • You are signed in as a user for whom <Your Company Name> is the home directory.
  • Delete all users except yourself.
  • Directory has one or more subscriptions to Microsoft Online Services.
  • Directory has one or more Azure subscriptions.
  • Directory has one or more applications.
  • Directory has one or more Multi-Factor Authentication providers.
  • Directory is a “Partner” directory.
  • Directory contains one or more applications that were added by a user or administrator.

You are signed in as a user for whom <Your Company Name> is the home directory

Make sure that your directory has no home users, and then delete the directory. The user who deletes this directory must be a guest user, must be homed in another directory, and must be a global admin of the directory that is being deleted.

For example, your directory has the domains contoso.onmicrosoft.com and contoso.com. There must be no users who have these domains in your directory. The guest user may be a Microsoft account or may be homed from another directory such as fabrikam.onmicrosoft.com.

To learn more about how to add a guest user, see Create or edit users. When you create this user in your directory, select one of the following:

  • A user who has an existing Microsoft account
  • A user in another Azure AD directory

This user must also be an admin of your Azure subscription.

Delete all users except yourself

Do what the message tells you to do. That is, delete all users except yourself.

Directory has one or more subscriptions to Microsoft Online Services

Do you have one of the following subscriptions?

  • Office 365
  • Intune
  • Dynamics
  • Microsoft Azure Information Protection (previously known as Microsoft Azure Rights Management)
  • Azure Active Directory Premium

If you have one of these subscriptions, contact billing and subscriptions support.

Do you have one of the following subscriptions?

  • Microsoft Enterprise Mobility + Security
  • Azure Active Directory Basic

If you have one of these subscriptions, contact your Volume Licensing partner to cancel the subscription.

Directory has one or more Azure subscriptions

If you have an Azure subscription, make sure that your Azure subscription is not linked to another directory. To do this, follow these steps:

  1. In the navigation pane, select Settings, and select Subscriptions.
  2. Notice the following information:
    • Subscription
    • Account administrator
    • Directory
  3. If the directory that you are trying to delete is listed under any of the subscriptions, the account administrator has to sign in and change the directory that is associated with the subscription. To do this, the account administrator should follow these steps:
    1. On this screen, select Edit Directory.
    2. In the Edit Directory window, select the Directory list, and then change the directory.

Directory has one or more applications

To learn how to remove applications from your directory, read Adding, updating, and removing an application

You may also have to remove additional service principals. Use Azure Active Directory Module for Windows PowerShell to remove all service principals. To do this, follow these steps:

  1. Open Azure Active Directory Module for Windows PowerShell.
  2. Connect to the Microsoft Online Service.
  3. Run the following command:
Get-MsolServicePrincipal | Remove-MsolServicePrincipal

Directory has one or more Multi-Factor Authentication providers

Remove Azure multi-factor authentication providers for your directory. For information about how do this, see Plan an Azure Multi-Factor Authentication deployment.

Directory is a ‘Partner’ directory

Contact Microsoft Partner Support at Microsoft Partner Site.

Directory contains one or more applications that were added by a user or administrator

To fix this issue, follow the steps in “Cannot delete” error when you try to delete a B2C directory in Azure AD.

So, that’s all in this blog. I will meet you soon with next stuff. Have a nice day!!!

Guys please don’t forget to like and share the post. Also join our WindowsTechno Community and where you can post your queries/doubts and our experts will address them.

You can also share the feedback on below windows techno email id.

If you have any questions, feel free to contact us on admin@windowstechno.com also follow us on facebook@windowstechno to get updates about new blog posts.

How useful was this post?

Click on a star to rate it!

As you found this post useful...

Follow us on social media!

Was this article helpful?
YesNo

Vipan Kumar

He is an Active Directory Engineer. He has been working in IT industry for more than 10 years. He is dedicated and enthusiastic information technology expert who always ready to resolve any technical problem. If you guys need any further help on subject matters, feel free to contact us on admin@windowstechno.com Please subscribe our Facebook page as well website for latest article. https://www.facebook.com/windowstechno

Leave a Reply

Back to top button