Created
June 26, 2023 13:45
-
-
Save mayrund/e13f016aeef9a5e38d2bc5ab2f1aecca to your computer and use it in GitHub Desktop.
Azure Disable & Delete App Registration Roles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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