未加星标

Deleting an Azure AD Tenant

字体大小 | |
[系统(windows) 所属分类 系统(windows) | 发布者 店小二05 | 时间 2016 | 作者 红领巾 ] 0人收藏点击收藏

Earlier last week I had a need to delete an Azure AD tenant, and this turned out to be a much more difficult task than I had originally anticipated so I thought I would document the steps I went through in case others encounter the same problems.

1. Disable AD Sync

If your syncing your on-prem AD up to Azure AD you need to disable this from inside the Azure Portal so that it disconnects your users from the sync, otherwise you cannot delete your synced users.

2. Remove Applications

You want to do this step before deleting users, you will see why in a moment.

The first step is to delete applications from inside the portal, that is fairly straight forward, just select the app and delete it. However if this was all you did you would get an error when trying to delete the tenant that applications still exist. There are likely to be some hidden applications that need to be deleted using PowerShell.

This is where the need for a user account comes in, you will need a global admin that is hosted in that tenant, so not a live account of account from another directory. You will also need the Microsoft Online Services Sign-In Assistant for IT Professionals RTW and "Azure Active Directory Module for windows PowerShell tools installed.

Once these are installed, open up PowerShell and run

Connect-MsolService

And sign in with your global admin credentials. Once you are signed in you can run

Get-MsolServicePrincipal | Select DisplayName

To see the list of applications in the tenant and finally run

Get-MsolServicePrincipal | Remove-MsolServicePrincipal

To delete these applications. You will get some errors on applications it cannot delete, that is fine, it will delete the ones that need to be deleted.

3. Remove Users

At this point you can now go ahead and delete any users in the domain, aside for your account which you will use to delete this tenant (and obviously can't originate from this tenant). If you can't delete any users from AD sync go back to step 1 and make sure it is disconnected.

4. Remove Custom Domains

If you have setup any custom domain names for the tenant go ahead and remove these now.

5. Remove Subscriptions

This is where the pain really started for me. If you have any subscriptions in your tenant (Azure AD basic or premium, office 365 etc.) then you need to remove these, and you can't do it your self. If you have AD Premium/Basic you need to raise a ticket either with your volume licence reseller, or with the office 365 billing team if you paid via credit card or are on a trial, do not raise a ticket in the Azure portal, they can't help.

This took me a few days to get things moving and get codes to remove the subscriptions, then it took a further 72 hours for them actually to get removed, so not a quick process.

6. Remove Tenant

At this point you should now be able to remove the tenant through the portal. If you get any errors at this point you'll need to run back over the steps here to make sure you removed everything. You can also take a look at this KB article .

本文系统(windows)相关术语:三级网络技术 计算机三级网络技术 网络技术基础 计算机网络技术

主题: PowerShellWindows
分页:12
转载请注明
本文标题:Deleting an Azure AD Tenant
本站链接:http://www.codesec.net/view/484780.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 系统(windows) | 评论(0) | 阅读(25)