Forum Discussion
Deleting a Teams App from a users Teams
alexl_2397 The question here is, How did you enable the app in MS Teams ? did you allow the app in the Teams admin center and add it to the Global App Permission policy or what ?
Ideally, when you enable a MS Teams app to a group of users, you need to create a custom App permission policy for it. Starting with, you want to make sure the app is allowed under the Teams admin center (Teams Apps > Manage Apps > either search for the app if exist already then allow it or upload your custom app here). once you do that, create a custom App Permission policy under Permission Policies, mimic the Global policy app settings and under the third party app or custom apps, add the Company Communicator App then assign this custom policy to the group of users who need to access the app. This way, you will make sure the app only available to the group of users who need it and not for all users. at the same time, when you remove the app from the Global App Permission policy, Teams will remove the app from all users automatically, no need to use any script to uninstall the app or install it.
The following Microsoft documents will guide you through the process and provide more insight on how to use app permission policies in Teams:
https://docs.microsoft.com/en-us/microsoftteams/app-policies
https://docs.microsoft.com/en-us/microsoftteams/teams-app-permission-policies
Throughout the deployment I followed the guidance provided on GitHub - https://github.com/OfficeDev/microsoft-teams-apps-company-communicator/wiki/Deployment-guide#6-install-the-apps-in-microsoft-teams
I published the user app through Teams (Desktop) by uploading the custom app; and then I published it through the Desktop App also (Creating the request, and then going into the Teams Admin Portal and approving it).
My plan was to create a permissions policy in order to control who has access so I can do testing; however the oversight when deploying the app via the ARM template (Having proactively install set to true) prevented that.
So now, as part of damage control and so I can continue testing without messaging the entire company, I'm trying to uninstall the app for everyone (I have an exported-list from Azure of everyone's User IDs) to do so - at the moment though I'm just testing the script itself on a single user.