# Unable to list users that have an app policy attached to them in Teams

**URL:** <https://forums.powershell.org/t/unable-to-list-users-that-have-an-app-policy-attached-to-them-in-teams/18087>\
**Category:** PowerShell Help\
**Created:** [November 30, 2021, 5:54pm UTC](https://forums.powershell.org/t/unable-to-list-users-that-have-an-app-policy-attached-to-them-in-teams/18087 "2021-11-30T17:54:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ebrolove](https://avatars.discourse-cdn.com/v4/letter/e/da6949/32.png) [@ebrolove](https://forums.powershell.org/u/ebrolove)\
**Post date:** [November 30, 2021, 5:54pm UTC](https://forums.powershell.org/t/unable-to-list-users-that-have-an-app-policy-attached-to-them-in-teams/18087/1 "2021-11-30T17:54:39Z")

</div>

How can I list the Teams users for which a custom App Permission policy is attached to ?  
Tried to locate the GUI and also went through the Microsoft documentation  
[Microsoft Teams apps permissions and considerations - Microsoft Teams | Microsoft Docs](https://docs.microsoft.com/en-us/microsoftteams/app-permissions)

The intention is to delete the custom policy but the GUI is complaining that I cannot delete it because there are users that have this policy assigned to them. But I could not list the users that have this policy attached/assigned to.

error  
“The policy “Allow Apps” is currently assigned to one or more users. You must assign a different policy to those users before you can delete this policy.”

Look at the screen shot so my question will be clear.

---

<div class="post-metadata">

**Author:** ![stevething](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/stevething/32/1904_2.png) [@stevething](https://forums.powershell.org/u/stevething)\
**Post date:** [November 30, 2021, 9:24pm UTC](https://forums.powershell.org/t/unable-to-list-users-that-have-an-app-policy-attached-to-them-in-teams/18087/2 "2021-11-30T21:24:51Z")

</div>

> [@ebrolove](#):
>
> Look at the screen shot so my question will be clear

I don’t see a screenshot attached to this thread. Did you mean something different?

---

<div class="post-metadata">

**Author:** ![random-commandline](https://avatars.discourse-cdn.com/v4/letter/r/e56c9b/32.png) [@random-commandline](https://forums.powershell.org/u/random-commandline)\
**Post date:** [November 30, 2021, 10:49pm UTC](https://forums.powershell.org/t/unable-to-list-users-that-have-an-app-policy-attached-to-them-in-teams/18087/3 "2021-11-30T22:49:43Z")

</div>

A Microsoft Teams module exists, but I am not familiar with it. Maybe the **Get-TeamUser or Remove-CsCustomPolicyPackage** cmdlet will get the results you need. Link is below.

> **[MicrosoftTeamsPowerShell Module](https://docs.microsoft.com/en-us/powershell/module/teams/?view=teams-ps)**
>
> The following cmdlet references are for Microsoft Teams.

---

<div class="post-metadata">

**Author:** ![ebrolove](https://avatars.discourse-cdn.com/v4/letter/e/da6949/32.png) [@ebrolove](https://forums.powershell.org/u/ebrolove)\
**Post date:** [December 1, 2021, 2:55pm UTC](https://forums.powershell.org/t/unable-to-list-users-that-have-an-app-policy-attached-to-them-in-teams/18087/4 "2021-12-01T14:55:36Z")

</div>

![tt](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/2X/a/a9613b987853cd1cae665cceac06deb2404a5548.png)

---

<div class="post-metadata">

**Author:** ![ebrolove](https://avatars.discourse-cdn.com/v4/letter/e/da6949/32.png) [@ebrolove](https://forums.powershell.org/u/ebrolove)\
**Post date:** [December 1, 2021, 3:02pm UTC](https://forums.powershell.org/t/unable-to-list-users-that-have-an-app-policy-attached-to-them-in-teams/18087/5 "2021-12-01T15:02:32Z")

</div>

Thanks a lot for this link.

But the problem I am having is, how can I identify the users for which a specific custom policy is assigned to. For instance, if I have a custom policy called “MyCustomPolicy” and if I have a user1 and user2 for which this custom policy is assigned to and assuming I do not know this policy was actually assigned to these two users, how would I list the users for which MyCustomPolicy is assigned to?

Thanks a lot!!!

---

<div class="post-metadata">

**Author:** ![ebrolove](https://avatars.discourse-cdn.com/v4/letter/e/da6949/32.png) [@ebrolove](https://forums.powershell.org/u/ebrolove)\
**Post date:** [December 1, 2021, 3:07pm UTC](https://forums.powershell.org/t/unable-to-list-users-that-have-an-app-policy-attached-to-them-in-teams/18087/6 "2021-12-01T15:07:34Z")

</div>

for instance the below will give me the policies attached to a specific user  
[Get-CsUserPolicyPackage (MicrosoftTeamsPowerShell) | Microsoft Docs](https://docs.microsoft.com/en-us/powershell/module/teams/get-csuserpolicypackage?view=teams-ps)

but what is I want a list of the users for which a specific policy is assigned to ?

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:20pm UTC](https://forums.powershell.org/t/unable-to-list-users-that-have-an-app-policy-attached-to-them-in-teams/18087/7 "2024-05-16T20:20:10Z")

</div>

Closed on May 16, 2024, 8:20pm UTC


