Problems deleting tenant.

Ralf Czekalla 1 Reputation point
2021-08-09T13:33:59.07+00:00

I have problems to delete a tenant I have created to enable a school for home schooling. The teachers decided to use a other platform. So I want to delete the tenant I created.
All users except the global admin are deleted. No groups are left.
I also deleted the Enterprise Applications thru powershell, none are displayed anymore.
Still receive the task "Delete all enterprise applications"
Found no other post that solved my issue.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,093 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Marilee Turscak-MSFT 36,866 Reputation points Microsoft Employee
    2021-08-09T22:19:58.777+00:00

    Since you are not seeing the application in the portal, you might be facing the same issue that the user in this MSDN thread was facing.

    For this user, the solution was to create a user within the tenant that he wanted to delete, followed by running this in Powershell:

    Connect-MsolService
    
    Get-MsolServicePrincipal | Remove-MsolServicePrincipal
    

    Then running:

    Get-AzureRmADApplication
    
    Get-AzureRmADApplication | Remove-AzureRmADApplication
    

    Then deleting the user, and then deleting the Azure Active Directory.

    One other common reason for this is an issue with the Microsoft Visual Studio Team Services Enterprise application. You can go to Enterprise Applications > Microsoft Visual Studio Team Services > Properties > flip “Enable for users to sign-in” to No, and this might resolve the issue.

    Do you see anything if you run Get-AzureADServicePrincipal? If so, you can remove these applications individually using Remove-AzureADServicePrincipal -objectid [ObjectID]

    Two additional commands you can also try:

    1)

    Get-AzureADServicePrincipal | Select-Object -ExpandProperty ObjectId | ForEach-Object { Remove-AzureADServicePrincipal -ObjectId $_}
    

    2)

    Get-AzureADServicePrincipal | ForEach-Object { Remove-AzureADServicePrincipal -ObjectId $_.ObjectId }
    

    Let me know if any of these things work for you. If you still have this issue you can reach out to me at AzCommunity@microsoft.com (Attn: Marilee Turscak), and I can get a support case opened for you.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.