Forum Discussion
Ethan Stern
Mar 04, 2020Iron Contributor
Powershell script to find out Teams policies by users
Hey everyone, do you know if there is a way to run a script to find what Teams policies are assigned to what user? We have a private channel policy in place- I would like to find out a list of users...
mattboi
Sep 27, 2021Copper Contributor
Hi John,
Get-CSOnlineUser only returns a value for Teams policies when they have been assigned directly. When policies are inherited from a group, they don't show up.
Get-CsUserPolicyAssignment will only return information about policies assigned directly or inherited. It won't return anything if you have the global default policy which make it hard to use to report a decent report.
Did anyone find a work around?
Thanks,
Get-CSOnlineUser only returns a value for Teams policies when they have been assigned directly. When policies are inherited from a group, they don't show up.
Get-CsUserPolicyAssignment will only return information about policies assigned directly or inherited. It won't return anything if you have the global default policy which make it hard to use to report a decent report.
Did anyone find a work around?
Thanks,
jchristie
Microsoft
Mar 08, 2023Late to the party but I've created a powershell function to show the order of policies (global, direct and groups if appropriate)
jchr-msft/TeamsAdmin (github.com)
Its not the fastest in the world, but it does the job