0

I am disabling permissions for everyone to chat on "General" Teams channel manually by

  1. clicking on (...)
  2. Manage channel
  3. selecting 'Only owners can post messages'

How can I do the same with PowerShell without any manual clicks?.

enter image description here

krishna
  • 575
  • 2
  • 8
  • 22

1 Answers1

0

The CsTeamsMessagingPolicy cmdlets enable administrators to control if a user is enabled to exchange messages.

Set-CsTeamsMessagingPolicy
   [-AllowUserChat <Boolean>] 

-AllowUserChat

Determines whether a user is allowed to chat. Set this to TRUE to allow a user to chat across private chat, group chat and in meetings. Set this to FALSE to prohibit all chat.

For example:

Set-CsTeamsMessagingPolicy -Identity StudentMessagingPolicy
-AllowUserChat $false -AllowMemes $false

In this example two different property values are configured: AllowUserChat is set to false and AllowMemes is set to False. All other policy properties will be left as previously assigned.

Ref:

https://learn.microsoft.com/en-us/powershell/module/skype/set-csteamsmessagingpolicy?view=skype-ps

Prasad-MSFT
  • 660
  • 1
  • 3
  • 7
  • I am thinking of disabling posting of messages for a particular channel for all the users, it seems like the above cmdlet is setting a policy for every user. – krishna Jan 19 '23 at 09:18
  • There doesn't seem to be any way to disable posting messages for all the users in a channel using PowerShell cmdlet. – Prasad-MSFT Jan 20 '23 at 10:41