Get-MSTUserPolicyAssignment-Html
Teams: HTML report of user policy assignments
#Requires -Version 5.1
[CmdletBinding()]
Param(
[Parameter(Mandatory = $true)]
[string]$Identity,
[ValidateSet('CallingLineIdentity','OnlineVoiceRoutingPolicy','TeamsAppSetupPolicy','TeamsAppPermissionPolicy','TeamsCallingPolicy','TeamsCallParkPolicy','TeamsChannelsPolicy','TeamsEducationAssignmentsAppPolicy','TeamsEmergencyCallingPolicy','TeamsMeetingBroadcastPolicy','TeamsEmergencyCallRoutingPolicy','TeamsMeetingPolicy','TeamsMessagingPolicy','TeamsUpdateManagementPolicy','TeamsUpgradePolicy','TeamsVerticalPackagePolicy','TeamsVideoInteropServicePolicy','TenantDialPlan')]
[string]$PolicyType
)
Process {
try {
[hashtable]$getArgs = @{'ErrorAction' = 'Stop'; 'Identity' = $Identity}
if (-not [System.String]::IsNullOrWhiteSpace($PolicyType)) {
$getArgs.Add('PolicyType', $PolicyType)
}
$result = Get-CsUserPolicyAssignment @getArgs | Select-Object *
if ($null -eq $result) {
Write-Output "No user policy assignments found"
return
}
Write-Output ($result | ConvertTo-Html -Fragment)
}
catch { throw }
}The user that will get their assigned policies
The type of the policy to filter