Commands › Microsoft Teams
Set-CsTeamsMessagingPolicy
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)
Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.