Thursday, December 27, 2018

How to Delete an AzureAD object that Won't Delete

1. Ok. You deleted a user from your on-premise Active Directory and it's still showing that bugger in Azure Active Directory. Your Google Kung-Fu is strong, but you can't find the dang commands. Here is what worked for me.

2. Get Connected via Powershell to Office365 / AzureAD:

https://www.microsoft.com/en-us/download/details.aspx?id=28177 (Install)
https://blog.migrationking.com/2018/12/how-to-connect-powershell-to-office365.html
https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-windows?view=azure-cli-latest (Install)

3. Install-Module -Name AzureAD

4. After your connected. Run the following command:

PS C:\Windows\system32> Remove-MsolUser -UserPrincipalName rick.james@unitedfederationofplanets.gov

Confirm
Continue with this operation?
[Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"): Y

5. Check your AzureAD portal to make sure it's gone.

https://aad.portal.azure.com/#blade/Microsoft_AAD_IAM/UsersManagementMenuBlade/AllUsers

6. Freaking dance man!




Reference Links:

https://www.itjon.com/removed-orphaned-o365-object-that-was-already-removed-from-your-local-ad/

Unhelpful Real World Training Junk:
https://support.office.com/office-training-center
https://docs.microsoft.com/en-us/office365/admin/admin-home?view=o365-worldwide
https://docs.microsoft.com/en-us/azure/active-directory/
https://docs.microsoft.com/en-us/microsoft-365/enterprise/index#pivot=home&panel=home-all
Share:

0 comments:

Post a Comment