How to Configure Teams Messaging Policies and Chat Governance Using PowerShell CsTeamsMessagingPolicy

In enterprise communication platforms, instant messaging and channel conversations drive daily collaboration. However, unmanaged chat features can quickly create regulatory compliance risks, security vulnerabilities, or workplace distractions. Organizations operating in regulated industries—such as healthcare, financial services, education, and legal consulting—often need to govern whether users can edit or delete sent messages, share animated GIFs, translate foreign language posts, or record audio voice memos in chats.

The primary administrative control governing chat and channel interaction in Microsoft Teams is the CsTeamsMessagingPolicy. Using the Microsoft Teams PowerShell module, administrators can inspect existing chat policies, establish strict compliance baselines, govern interactive multimedia features, and assign tailored messaging policies across departments and user groups.

Understanding CsTeamsMessagingPolicy Core Parameters

The CsTeamsMessagingPolicy cmdlets manage chat capabilities across desktop, mobile, and web clients. Key parameters include:

  • AllowUserEditMessage: Dictates whether users are permitted to edit sent chat messages. Often disabled in legal or financial trading environments for strict non-repudiation.
  • AllowUserDeleteMessage & AllowOwnersToDeleteMessage: Controls whether standard users or team owners can permanently remove posted messages.
  • AllowGiphy & GiphyRatingType: Controls whether animated Giphy search is enabled, and enforces content filtering levels (Strict, Moderate, or NoRestriction).
  • AllowUserTranslation: Enables in-line message translation powered by Microsoft Cognitive Services for multi-lingual international teams.
  • AllowUrlPreviews: Controls whether pasted hyperlinks automatically unfurl rich metadata and graphic previews.
  • AllowVoiceMessage: Dictates whether users can send recorded audio voice snippets in 1:1 and group chats.

Connecting to Microsoft Teams PowerShell

Launch an elevated PowerShell session on your administrative workstation and connect to the Microsoft 365 tenant:

Connect-MicrosoftTeams

Verify that your connection is established with appropriate Teams Administrator credentials:

Get-CsTenant | Select-Object DisplayName, TenantId

Inspecting Current Messaging Policies

To view all messaging policies currently configured within your tenant:

Get-CsTeamsMessagingPolicy

To inspect the default Global policy applied to all tenant users who do not have an explicit custom assignment:

Get-CsTeamsMessagingPolicy -Identity Global | Format-List Identity, Description, AllowUserEditMessage, AllowUserDeleteMessage, AllowGiphy, GiphyRatingType, AllowUserTranslation

The output displays the tenant-wide baseline settings for message editing, deletion, and content filtering.

Creating a Strict Compliance Messaging Policy

For departments handling sensitive regulatory compliance, financial records, or legal discovery where message permanence is mandatory, create a strict messaging policy that disables editing and deletion:

New-CsTeamsMessagingPolicy -Identity "StrictComplianceMessagingPolicy" -Description "Enforces message non-repudiation: prohibits message editing and deletion" -AllowUserEditMessage $false -AllowUserDeleteMessage $false -AllowOwnersToDeleteMessage $false -AllowGiphy $false -AllowVoiceMessage $false -AllowUserTranslation $true

This configuration guarantees that all posted communications remain intact for eDiscovery and compliance archiving.

Creating an Education or General Staff Messaging Policy

For educational institutions or standard corporate staff where interactive features enhance engagement but appropriate content filtering is necessary:

New-CsTeamsMessagingPolicy -Identity "StandardStaffMessagingPolicy" -Description "Enables standard collaboration with Strict Giphy ratings" -AllowUserEditMessage $true -AllowUserDeleteMessage $true -AllowGiphy $true -GiphyRatingType "Strict" -AllowUrlPreviews $true -AllowUserTranslation $true -AllowVoiceMessage $true

The Strict rating ensures that only G-rated, workplace-appropriate content is surfaced in animated GIF searches.

Modifying Existing Messaging Policies

To adjust settings on an existing policy without recreating it, use Set-CsTeamsMessagingPolicy:

Set-CsTeamsMessagingPolicy -Identity "StandardStaffMessagingPolicy" -GiphyRatingType "Moderate"

To globally disable URL previews across the entire tenant (mitigating phishing link unfurls):

Set-CsTeamsMessagingPolicy -Identity Global -AllowUrlPreviews $false

Assigning Messaging Policies to Users and Groups

Assign a custom messaging policy to an individual user using Grant-CsTeamsMessagingPolicy:

Grant-CsTeamsMessagingPolicy -Identity "[email protected]" -PolicyName "StrictComplianceMessagingPolicy"

To assign the policy across an entire departmental security group in Microsoft Entra ID:

Grant-CsTeamsMessagingPolicy -Group "Legal-Department-GroupID" -PolicyName "StrictComplianceMessagingPolicy" -Rank 1

To remove a custom assignment so a user reverts to the tenant Global baseline:

Grant-CsTeamsMessagingPolicy -Identity "[email protected]" -PolicyName $null

Verifying User Policy Assignment

Confirm the active policy applied to a user’s account:

Get-CsUserPolicyAssignment -Identity "[email protected]" -PolicyType TeamsMessagingPolicy

By leveraging CsTeamsMessagingPolicy in PowerShell, organizations strike an ideal balance between dynamic team collaboration and strict corporate compliance governance.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.