Skip to content

Instantly share code, notes, and snippets.

@pmatthews05
Created March 29, 2020 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pmatthews05/8006021182c1b7e0720a64b690d158f6 to your computer and use it in GitHub Desktop.
Save pmatthews05/8006021182c1b7e0720a64b690d158f6 to your computer and use it in GitHub Desktop.
$GroupName = "SalesUsers"
$PolicyName = "SalesPolicy"
az login
az ad group member list --group $GroupName --query "[?userType == 'Member']" `
| ConvertFrom-Json `
| % { Grant-CsTeamsMessagingPolicy -PolicyName $PolicyName -Identity $_.userPrincipalName }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment