Skip to content

Instantly share code, notes, and snippets.

@pmatthews05
Last active June 18, 2020 10:55
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 pmatthews05/7186d376fe42c4cdf75a6981cb7f0ef4 to your computer and use it in GitHub Desktop.
Save pmatthews05/7186d376fe42c4cdf75a6981cb7f0ef4 to your computer and use it in GitHub Desktop.
#Get all permissions for the Application Registration
$currentPermissionCollection = @(az ad app permission list --id $AppId | ConvertFrom-Json)
#Remove the permissions (resourceAppId) for the Application Registration
$currentPermissionCollection | ForEach-Object {
$permission = $PSItem
if ($permission.Count -eq 0) { return }
$permission.resourceAppId | ForEach-Object{
$resourceAppId = $PSItem
az ad app permission delete --id $AppId --api $resourceAppId
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment