Skip to content

Instantly share code, notes, and snippets.

@mayrund
Created June 26, 2023 13:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mayrund/e13f016aeef9a5e38d2bc5ab2f1aecca to your computer and use it in GitHub Desktop.
Save mayrund/e13f016aeef9a5e38d2bc5ab2f1aecca to your computer and use it in GitHub Desktop.
Azure Disable & Delete App Registration Roles
# Disable and delete app registration roles
Connect-AzureAD
$registrationName = '<APP-REGISTRATION-NAME>'
$application = Get-AzureADApplication -Filter "DisplayName eq '$registrationName'"
$application.AppRoles.ForEach({ $_.IsEnabled = $false })
Set-AzureADApplication -ObjectId $application.ObjectId -AppRoles $application.AppRoles
Set-AzureADApplication -ObjectId $application.ObjectId -AppRoles @()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment