question

RalfCzekalla-5161 avatar image
0 Votes"
RalfCzekalla-5161 asked MarileeTurscak-MSFT answered

Problems deleting tenant.

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.

azure-ad-tenant
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MarileeTurscak-MSFT avatar image
0 Votes"
MarileeTurscak-MSFT answered

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.




5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.