How to Configure Teams Media Logging Policies and Diagnostic Call Tracing Using PowerShell CsTeamsMediaLoggingPolicy

Troubleshooting enterprise voice and video call quality issues—such as jitter, packet loss, audio chopping, and one-way audio—often requires granular media telemetry captured directly from the client endpoint. While standard Microsoft Teams diagnostic logs capture application events, detailed real-time transport protocol (RTP) packet traces, audio processing metric logs, and codec negotiation payloads are suppressed by default to protect disk space and client performance. To assist network engineers in diagnosing complex audio/video degradations, Microsoft Teams provides administrative control over client-side media logging through the Microsoft Teams PowerShell module. Using CsTeamsMediaLoggingPolicy, enterprise administrators can enable, assign, and govern diagnostic media logging across targeted user populations.

Understanding CsTeamsMediaLoggingPolicy Capabilities

The CsTeamsMediaLoggingPolicy cmdlet suite controls whether Microsoft Teams desktop clients capture detailed diagnostic media logs during peer-to-peer calls, conference meetings, and live events. The policy governs:

  • MediaLoggingMode: Toggles the client’s internal media logging engine. When set to Enabled, Teams instructs the underlying media stack (WebRTC / Skype Web Core) to write verbose RTP telemetry, WebRTC trace logs, acoustic echo cancellation (AEC) metrics, and jitter buffer performance logs to local disk.
  • Targeted Diagnostic Scoping: Allows network operations teams to selectively enable verbose logging for VIP executives, trouble-ticket filers, or remote branch personnel experiencing VoIP anomalies without inundating all tenant endpoints with large log files.
  • Client Platform Coverage: Applies across Microsoft Teams desktop clients on Windows and macOS.

Connecting to Microsoft Teams PowerShell

Launch an elevated PowerShell session and authenticate to your tenant using an account with the Teams Administrator or Global Administrator Entra ID role:

# Import Microsoft Teams module
Import-Module MicrosoftTeams

# Authenticate to tenant
Connect-MicrosoftTeams

Auditing Existing Media Logging Policies

Query the tenant to review all configured media logging policies, including the default Global policy:

Get-CsTeamsMediaLoggingPolicy | Select-Object Identity, Description, MediaLoggingMode

To inspect the detailed parameter list of the Global policy:

Get-CsTeamsMediaLoggingPolicy -Identity "Global" | Format-List

By default in most Microsoft 365 tenants, MediaLoggingMode is set to Disabled in the Global policy to optimize client performance.

Creating a Custom Media Logging Diagnostic Policy

To enable media logging for targeted troubleshooting scenarios without impacting standard tenant users, create a dedicated diagnostic policy using New-CsTeamsMediaLoggingPolicy:

New-CsTeamsMediaLoggingPolicy -Identity "Diagnostic-MediaLogging-Enabled" `
    -Description "Enables verbose media and RTP packet logging for troubleshooting call quality" `
    -MediaLoggingMode "Enabled"

To establish a policy that explicitly revokes media logging:

New-CsTeamsMediaLoggingPolicy -Identity "Diagnostic-MediaLogging-Disabled" `
    -Description "Explicitly disables verbose media logging" `
    -MediaLoggingMode "Disabled"

Modifying Existing Media Logging Policies

To adjust the operational mode of an existing policy, execute Set-CsTeamsMediaLoggingPolicy:

Set-CsTeamsMediaLoggingPolicy -Identity "Diagnostic-MediaLogging-Enabled" `
    -MediaLoggingMode "Enabled"

Assigning Media Logging Policies to Users and Pilot Groups

Assign the diagnostic policy directly to users experiencing voice degradation or to designated network test accounts:

# Assign directly to a user filing a support ticket
Grant-CsTeamsMediaLoggingPolicy -Identity "[email protected]" `
    -PolicyName "Diagnostic-MediaLogging-Enabled"

# Bulk assign across a pilot branch testing network routing
Get-AzADGroupMember -GroupDisplayName "Chicago Office Pilot Users" | ForEach-Object {
    Grant-CsTeamsMediaLoggingPolicy -Identity $_.UserPrincipalName `
        -PolicyName "Diagnostic-MediaLogging-Enabled"
}

To verify the effective policy assigned to an employee:

Get-CsUserPolicyAssignment -Identity "[email protected]" | Where-Object { $_.PolicyType -eq "TeamsMediaLoggingPolicy" }

Collecting and Analysing Client Media Logs

Once assigned, instruct the user to completely restart the Microsoft Teams desktop client and reproduce the call quality issue. Once the test call concludes, locate the generated media logs on the client machine:

On Windows:

%appdata%\Microsoft\Teams\media-stack\
# For the new Microsoft Teams client:
%localappdata%\Packages\MSTeams_8wekyb3d8bbwe\LocalCache\Microsoft\MSTeams\Logs\

On macOS:

~/Library/Application Support/Microsoft/Teams/media-stack/

Inspect the media log files (such as *.etl, *.blog, or text-based media trace logs) using the Microsoft Call Quality Dashboard (CQD), Wireshark, or the Microsoft Teams Network Assessment Tool to pinpoint round-trip delay times, audio frame concealment rates, and DSCP QoS marking preservation.

Reverting the Policy Post-Troubleshooting

Because continuous verbose media logging consumes client disk space over extended periods, revert the user back to the default Global policy once diagnostics conclude:

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

Utilizing CsTeamsMediaLoggingPolicy via PowerShell ensures enterprise network teams can rapidly capture forensic audio/video telemetry on demand while maintaining optimal baseline performance across Microsoft Teams.

Get the best tech tips delivered straight to your inbox.

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