Forum Discussion
PhilC42
Sep 08, 2020Copper Contributor
Unable to delete Teams app permissions policy
We have an app permissions policy in Teams so we can test out some add-in apps, we are unable to delete the policy because it is impossible to delete without first going through each user is has been...
VasilMichev
Sep 08, 2020MVP
You can simply use PowerShell to switch policies and delete the one you need?
Michael Davis
Nov 30, 2020Copper Contributor
Yes but...
I have a similar case. We have a custom policy that .. as far as I can tell... has no members. But we can't delete it because, according to Teams, it does. So we need to re-assign the policy to all the current members of the policy.
Even this command requires that we know who to apply it to: https://docs.microsoft.com/en-us/powershell/module/teams/get-csuserpolicyassignment?view=teams-ps
So is there a way to get a list of everyone assigned to policy X?
- SteveBApr 01, 2021Brass Contributor
PhilC42 & Michael Davis I have used the following to get all users with a specific app permission policy assigned
Get-CsOnlineUser -Filter {TeamsAppPermissionPolicy -eq 'Policy Name Here'} | Select UserPrincipalName
Then you can assign another policy for those users and delete the old one.
Now if only someone could tell me how to remove the deleted user from the other policy I want to remove 🙂
- rgrimmSep 29, 2021Copper Contributor
Good script!
Just ran into this today. Not sure about PowerShell, but you can reassign the App permission policy from the Teams admin center under Users > Manage users. Search for the user then under the Policies tab find your App permission policy and change it to whatever you want and Save. Says it may take a few hours to update, but it was immediate for me.
This cmdlet looks promising, but I couldn't get it to work for me (or others) as it appears there are several issues with the Teams PowerShell cmdlets in general.
Grant-CsTeamsAppPermissionPolicy (SkypeForBusiness) | Microsoft Docs- estein1030Aug 16, 2022Copper Contributor
rgrimm for anyone googling this, you can now filter by policy in the Teams Admin Center under Manage users, and export the results into .csv. Makes finding users with a specific policy assigned much easier.
One issue you might run into is disabled users. The users may still show in the Teams admin center as having the policy you want to delete applied, but you can't remove the policy via the admin center or PowerShell. It can be a painful wait to re-enable users just so you can remove the policy and delete it.