Skip to content

Instantly share code, notes, and snippets.

@garrytrinder
Last active August 21, 2023 12:43
Show Gist options
  • Save garrytrinder/fc036a931ba0f529339687ea5c2e0f18 to your computer and use it in GitHub Desktop.
Save garrytrinder/fc036a931ba0f529339687ea5c2e0f18 to your computer and use it in GitHub Desktop.
Remove Azure AD app registrations
$notToRemove = @("app1","app2")
$apps = m365 teams app list | ConvertFrom-JSON
$apps | Where-Object { $_.displayName -notin $notToRemove } | ForEach-Object { m365 aad app remove --appId $_.appId --confirm }
$apps = m365 teams app list | ConvertFrom-JSON
$apps | ForEach-Object { m365 aad app remove --appId $_.appid --confirm }
@garrytrinder
Copy link
Author

Added script that will ignore apps with a given name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment