Azure AAD Cleanup for AzureStack

After you finished testing your current build of Azure Stack you may want to clean up your Azure AD application registration. Here is a quick way to clean up all the AAD application registrations.

NOTE: USE THIS AT YOUR OWN RISK. THIS WILL CLEAN UP EVERY REGISTRATION.

################ SCRIPT BEGINING ########################

# Name: CleanAAD-AppReg.ps1

# Author: Carlos Vargas

# Clean Azure AAD App Registration

#https://www.powershellgallery.com/packages/AzureADPreview/2.0.0.52
# 1. Install AAD Preview Module : Install-Module -Name AzureADPreview

# Get Creds
$AzureAadCreds = Get-Credential

Connect-AzureAD -Credential $AzureAadCreds

# Get the App Registrations
Get-AzureADServicePrincipal

# Remove the App Service Principal
Get-AzureADServicePrincipal | Remove-AzureADServicePrincipal

# Get Azure AD Applications
Get-AzureADApplication | Remove-AzureADApplication

Subscribe For Latest Updates

Sign up for best of digital marketing, livestream and technology opinions on what matters to you.

Invalid email address
We promise not to spam you. You can unsubscribe at any time.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: