Last active
August 21, 2023 12:43
-
-
Save garrytrinder/fc036a931ba0f529339687ea5c2e0f18 to your computer and use it in GitHub Desktop.
Remove Azure AD app registrations
This file contains hidden or 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
$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 } |
This file contains hidden or 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
$apps = m365 teams app list | ConvertFrom-JSON | |
$apps | ForEach-Object { m365 aad app remove --appId $_.appid --confirm } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Added script that will ignore apps with a given name