When working with Microsoft Teams, a fairly new feature is the ability to assign Teams Policies to groups of accounts. Teams itself, has not really supported this, even though you could assign policies to teams, you would need to use PowerShell, to get the Azure Active Directory Group, then iterate the group members assigning the policies to each member. Microsoft then releases the batch commands to hell with this, which would take an array of accounts and perform the same task of assigning to each account.

The better way of doing this is to use the Teams Admin Center or PowerShell. Adding them is as simple of navigating to the selected policies, then choose the Group Assignment tab, then configure as needed.

I prefer PowerShell, so as such here is an example of the PowerShell you would use:

$group = Get-AzureADGroup -SearchString "All Company"
New-CsGroupPolicyAssignment `
          -GroupId $group.ObjectId `
          -PolicyType "TeamsMessagingPolicy" `
          -PolicyName "Messaging Policy"

To add other types, the “PolicyType” parameter can be either of these values:

  • TeamsMessagingPolicy
  • TeamsMeetingPolicy
  • TeamsCallingPolicy
  • TeamsMeetingBroadcastPolicy
  • TeamsAppSetupPolicy
  • TeamsChannelsPolicy

Using PowerShell allows better flexibility and can be scripted into functions such as this (Not using MFA):

function Invoke-AssignTeamsPolicyToGroup()
        [ValidateSet('TeamsMessagingPolicy', `

    $Group = Get-AzureADGroup -All:$true | `
               Where-Object { $_.DisplayName -eq $GroupName }

        Write-Host "Assigning: $($PolicyType) Policy" `
               -ForegroundColor Yellow

        New-CsGroupPolicyAssignment `
               -GroupId $Group.ObjectId `
               -PolicyType "$($PolicyType)" `
               -PolicyName "$($PolicyName)"

        Write-Host "Assigned: $($PolicyType) Policy" `
               -ForegroundColor Green
        Write-Host "Please check policy and try again" `
               -ForegroundColor Red

This is just an example of what you could do. Hope this helps.