Commands › Microsoft Teams

Set-CsTeamsMessagingPolicy

Microsoft Teams MicrosoftTeams Set-*

The CsTeamsMessagingPolicy cmdlets enable administrators to control if a user is enabled to exchange messages. These also help determine the type of messages users can create and modify.

Quick start script

# Set-CsTeamsMessagingPolicy — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-MicrosoftTeams -CertificateThumbprint $thumb -ApplicationId $appId -TenantId $tenantId

# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-CsTeamsMessagingPolicy
$before | Format-List

# 3. Make the change (dry run first)
Set-CsTeamsMessagingPolicy  -WhatIf
Set-CsTeamsMessagingPolicy

# 4. Verify and diff
$after = Get-CsTeamsMessagingPolicy
Compare-Object ($before | Out-String) ($after | Out-String)

Syntax — 2 parameter sets

Identity (Default)

Set-CsTeamsMessagingPolicy [[-Identity] <XdsIdentity>]
 [-AllowChatWithGroup <Boolean>]
 [-AllowCommunicationComplianceEndUserReporting <Boolean>]
 [-AllowCustomGroupChatAvatars <Boolean>]
 [-AllowExtendedWorkInfoInSearch <String>]
 [-AllowFluidCollaborate <Boolean>]
 [-AllowFullChatPermissionUserToDeleteAnyMessage <Boolean>]
 [-AllowGiphy <Boolean>]
 [-AllowGiphyDisplay <Boolean>]
 [-AllowGroupChatJoinLinks <Boolean>]
 [-AllowImmersiveReader <Boolean>]
 [-AllowMemes <Boolean>]
 [-AllowOwnerDeleteMessage <Boolean>]
 [-AllowPasteInternetImage <Boolean>]
 [-AllowPriorityMessages <Boolean>]
 [-AllowRemoveUser <Boolean>]
 [-AllowSecurityEndUserReporting <Boolean>]
 [-AllowSmartCompose] <Boolean>]
 [-AllowSmartReply <Boolean>]
 [-AllowStickers <Boolean>]
 [-AllowUrlPreviews <Boolean>]
 [-AllowUserChat <Boolean>]
 [-AllowUserDeleteChat <Boolean>]
 [-AllowUserDeleteMessage <Boolean>]
 [-AllowUserEditMessage <Boolean>]
 [-AllowUserTranslation <Boolean>]
 [-AllowVideoMessages <Boolean>]
 [-AudioMessageEnabledType <AudioMessageEnabledTypeEnum>]
 [-ChannelsInChatListEnabledType <ChannelsInChatListEnabledTypeEnum>]
 [-ChatPermissionRole <String>]
 [-Confirm]
 [-CreateCustomEmojis <Boolean>]
 [-DeleteCustomEmojis <Boolean>]
 [-Description <String>]
 [-DesignerForBackgroundsAndImages <DesignerForBackgroundsAndImagesTypeEnum>]
 [-Force]
 [-GiphyRatingType <String>]
 [-InOrganizationChatControl <String>]
 [-ReadReceiptsEnabledType <String>]
 [-Tenant <Guid>]
 [-UsersCanDeleteBotMessages <Boolean>]
 [-AutoShareFilesInExternalChats <String>]
 [-UseB2BInvitesToAddExternalUsers <String>]
 [-WhatIf]
 [<CommonParameters>]

Instance

Set-CsTeamsMessagingPolicy [-Instance <PSObject>]
 [-AllowChatWithGroup <Boolean>]
 [-AllowCommunicationComplianceEndUserReporting <Boolean>]
 [-AllowCustomGroupChatAvatars <Boolean>]
 [-AllowExtendedWorkInfoInSearch <String>]
 [-AllowFluidCollaborate <Boolean>]
 [-AllowFullChatPermissionUserToDeleteAnyMessage <Boolean>]
 [-AllowGiphy <Boolean>]
 [-AllowGiphyDisplay <Boolean>]
 [-AllowGroupChatJoinLinks <Boolean>]
 [-AllowImmersiveReader <Boolean>]
 [-AllowMemes <Boolean>]
 [-AllowOwnerDeleteMessage <Boolean>]
 [-AllowPasteInternetImage <Boolean>]
 [-AllowPriorityMessages <Boolean>]
 [-AllowRemoveUser <Boolean>]
 [-AllowSecurityEndUserReporting <Boolean>]
 [-AllowSmartCompose] <Boolean>]
 [-AllowSmartReply <Boolean>]
 [-AllowStickers <Boolean>]
 [-AllowUrlPreviews <Boolean>]
 [-AllowUserChat <Boolean>]
 [-AllowUserDeleteChat <Boolean>]
 [-AllowUserDeleteMessage <Boolean>]
 [-AllowUserEditMessage <Boolean>]
 [-AllowUserTranslation <Boolean>]
 [-AllowVideoMessages <Boolean>]
 [-AudioMessageEnabledType <AudioMessageEnabledTypeEnum>]
 [-ChannelsInChatListEnabledType <ChannelsInChatListEnabledTypeEnum>]
 [-Confirm]
 [-CreateCustomEmojis <Boolean>]
 [-DeleteCustomEmojis <Boolean>]
 [-Description <String>]
 [-DesignerForBackgroundsAndImages <DesignerForBackgroundsAndImagesTypeEnum>]
 [-Force]
 [-GiphyRatingType <String>]
 [-InOrganizationChatControl <String>]
 [-ReadReceiptsEnabledType <String>]
 [-Tenant <Guid>]
 [-UsersCanDeleteBotMessages <Boolean>]
 [-AutoShareFilesInExternalChats <String>]
 [-UseB2BInvitesToAddExternalUsers <String>]
 [-WhatIf]
 [<CommonParameters>]

Parameters (45)

ParameterTypeRequiredWhat it controls
-AllowChatWithGroup Boolean This setting determines if users can chat with groups (Distribution, M365 and Security groups). Possible values: True, False
-AllowCommunicationComplianceEndUserReporting Boolean This setting determines if users can report offensive messages to their admin for Communication Compliance. Possible Values: True, False
-AllowCustomGroupChatAvatars Boolean These settings enables, disables updating or fetching custom group chat avatars for the users included in the messaging policy. Possible values: True, False
-AllowExtendedWorkInfoInSearch Boolean This setting enables/disables showing company name and department name in search results for MTO users.
-AllowFluidCollaborate Boolean This field enables or disables Fluid Collaborate feature for users. Possible values: True, False
-AllowFullChatPermissionUserToDeleteAnyMessage Boolean This setting determines if users with the 'Full permissions' role can delete any group or meeting chat message within their tenant. Possible values: True, False
-AllowGiphy Boolean Determines whether a user is allowed to access and post Giphys. Set this to TRUE to allow. Set this FALSE to prohibit.
-AllowGiphyDisplay Boolean Determines if Giphy images should be displayed that had been already sent or received in chat. Possible values: True, False
-AllowGroupChatJoinLinks Boolean This setting determines if users in a group chat can create and share join links for other users within the organization to join that chat. Possible values: True, False
-AllowImmersiveReader Boolean Determines whether a user is allowed to use Immersive Reader for reading conversation messages. Set this to TRUE to allow. Set this FALSE to prohibit.
-AllowMemes Boolean Determines whether a user is allowed to access and post memes. Set this to TRUE to allow. Set this FALSE to prohibit.
-AllowOwnerDeleteMessage Boolean Determines whether owners are allowed to delete all the messages in their team. Set this to TRUE to allow. Set this to FALSE to prohibit.
-AllowPasteInternetImage Boolean Determines if a user is allowed to paste internet-based images in compose. Possible values: True, False
-AllowPriorityMessages Boolean Determines whether a user is allowed to send priority messages. Set this to TRUE to allow. Set this FALSE to prohibit.
-AllowRemoveUser Boolean Determines whether a user is allowed to remove a user from a conversation. Set this to TRUE to allow. Set this FALSE to prohibit.
-AllowSecurityEndUserReporting Boolean This setting determines if users can report any security concern posted in message to their admin. Possible values: True, False
-AllowSmartCompose Boolean Turn on this setting to let a user get text predictions for chat messages.
-AllowSmartReply Boolean Turn this setting on to enable suggested replies for chat messages. Set this to TRUE to allow. Set this to FALSE to prohibit.
-AllowStickers Boolean Determines whether a user is allowed to access and post stickers. Set this to TRUE to allow. Set this FALSE to prohibit.
-AllowUrlPreviews Boolean Use this setting to turn automatic URL previewing on or off in messages. Set this to TRUE to turn on. Set this to FALSE to turn off.
-AllowUserChat Boolean 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.
-AllowUserDeleteChat Boolean Turn this setting on to allow users to permanently delete their 1:1, group chat, and meeting chat as participants (this deletes the chat only for them, not other users in the chat). Set this to TRUE to allow. Set...
-AllowUserDeleteMessage Boolean Determines whether a user is allowed to delete their own messages. Set this to TRUE to allow. Set this to FALSE to prohibit. If this value is set to FALSE, the team owner will not be able to delete their own messages.
-AllowUserEditMessage Boolean Determines whether a user is allowed to edit their own messages. Set this to TRUE to allow. Set this to FALSE to prohibit.
-AllowUserTranslation Boolean Determines whether a user is allowed to translate messages to their client languages. Set this to TRUE to allow. Set this to FALSE to prohibit.
-AllowVideoMessages Boolean This setting determines if users can create and send video messages. Possible values: True, False
-AudioMessageEnabledType AudioMessageEnabledTypeEnum Determines whether a user is allowed to send audio messages. Possible values are: ChatsAndChannels, ChatsOnly, Disabled.
-ChannelsInChatListEnabledType ChannelsInChatListEnabledTypeEnum On mobile devices, enable to display favorite channels above recent chats.
-ChatPermissionRole String Determines the Supervised Chat role of the user. Set this to Full to allow the user to supervise chats. Supervisors have the ability to initiate chats with and invite any user within the environment. Set this to...
-Confirm SwitchParameter Prompts you for confirmation before running the cmdlet.
-CreateCustomEmojis Boolean This setting enables the creation of custom emojis and reactions within an organization for the specified policy users.
-DeleteCustomEmojis Boolean These settings enable and disable the editing and deletion of custom emojis and reactions for the users included in the messaging policy.
-Description String Provide a description of your policy to identify purpose of creating it.
-DesignerForBackgroundsAndImages DesignerForBackgroundsAndImagesTypeEnum This setting determines whether a user is allowed to create custom AI-powered backgrounds and images with MS Designer.
-Force SwitchParameter The Force switch specifies whether to suppress warning and confirmation messages. It can be useful in scripting to suppress interactive prompts. If the Force switch isn't provided in the command, you're prompted for...
-GiphyRatingType String Determines the Giphy content restrictions applicable to a user. Set this to STRICT, MODERATE or NORESTRICTION.
-Identity XdsIdentity Identity for the teams messaging policy you're modifying. To modify the global policy, use this syntax: -Identity global. To modify a per-user policy, use syntax similar to this: `-Identity TeamsMessagingPolicy`.
-InOrganizationChatControl String This setting determines if chat regulation for internal communication in the tenant is allowed.
-Instance PSObject Allows you to pass a reference to an object to the cmdlet rather than set individual parameter values.
-ReadReceiptsEnabledType String Use this setting to specify whether read receipts are user controlled, enabled for everyone, or disabled. Set this to UserPreference, Everyone or None.
-Tenant Guid Globally unique identifier (GUID) of the tenant account whose external user communication policy are being created. For example:
-UsersCanDeleteBotMessages Boolean Determines whether a user is allowed to delete messages sent by bots. Set this to TRUE to allow. Set this to FALSE to prohibit.
-UseB2BInvitesToAddExternalUsers Boolean Indicates whether B2B invites should be used to add external users when necessary.
-AutoShareFilesInExternalChats String Determines whether files are automatically shared in external chats.
-WhatIf SwitchParameter Shows what would happen if the cmdlet runs. The cmdlet is not run.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.