Delete an Azure AD directory with PowerShell

Last year Microsoft announced a demo platform where Azure tenants can be create quiet easy which is for 90 days valid.  On the top it can be deployed some useful extensions for example Office 365 or Enterprise Mobility Suite.

This platform was very useful for me to create and show my customers some use cases and interesting features.

At the beginning Microsoft had some troubles with this tool first of all with the subscriptions. After the demo tenant creation the provisioning of them wasn’t always successfully too.

This year this platform will be migrated to the new one. It becomes a new design, but the background processes won’t be better or more effective.

UPDATE:

If you missed it, we rolled over to the new Microsoft demos website and now have included Advanced Threat Analytics!

What’s new:

  • A new refreshed UI, with Microsoft branding reflecting all services now provisioned by the demo environment, and improved navigation.
  • A modular approach to give you more flexibility – creating an environment and preparing a demo are two separate steps.
  • To set up a demo environment, select Tenant – you can set up to 6 tenants, leveraging quick tenants or custom tenants.
  • To prepare a demo, select  Demo – pick the scripts and content that is right for you a complete demo resource pack will be generated for you.
  • Advanced Threat Analytics (ATA) is an on-premise product, the demo environment is designed as a static website with limited functionality showcasing abnormal user behavior, suspicious activities, and user profile scenarios.

A few call outs!

  • Quick tenants: Creating a tenant is now FAST, fast, fast –Rather than the earlier 24-48 hours process, the creation to tenant provisioning process now takes only about 3 hours now.
  • Cap on tenant creation: You can create a maximum of 6 quick tenants. To create a custom tenant (with personalization and following the traditional, longer process), you will need to add the GSX id and will be considered only in case of extremely critical scenarios.
  • Office365: All tenants are now E5.

For more on the changes in the process to create new tenants and demos, please refer the attached document (also on demos.microsoft.com as well) which is EMS specific.

Submit feedback or request support with the demo: EMSDemoSupport@microsoft.com

However the support with the ticketing system is working quiet well. I can say it from my experience… 😉

Anyway it is (or could be) a nice opportunity to test for example the new features or tools regarding O365 or EMS! Please try it, hopefully you will have more success than me.

In this post I describe how I could clean my subscriptions and delete my failed Azure tenant directories and so on. I thought I will login into the the Azure Portal and will combine and migrate my subscriptions. AzureAD’s that I don’t need it, I can remove etc.

The whole story isn’t so easy. That’s why I am writing this short blog post now.

Issue: I created with my Microsoft LiveID following Azure AD’s:1

After I tried to delete these directories, got the following pop up:

2

For sure I couldn’t because it wasn’t empty. However, remove these users in the Azure portal is quiet painful. Maybe you can use Office 365 Admin portal. Who can still help you?? For sue, Mr. PowerShell! 🙂

With this simple command you ar enable to delete each Azure AD user except your global admin:4

After this cleaning task you have to wait some minutes until your Azure Portal checks that it’s empty:

3

Then it will be removed from the list automatically.

Related link: https://support.microsoft.com/en-us/kb/2967860

PS: if you use this enviroment and create some test tenants, please change first the default admin password!!

Leave a Reply

Your email address will not be published.