How to Configure Teams VDI Optimization Policies Using PowerShell CsTeamsVdiPolicy

Deploying Microsoft Teams in Virtual Desktop Infrastructure (VDI) environments—such as Azure Virtual Desktop (AVD), Citrix Virtual Apps and Desktops, and VMware Horizon—presents unique performance considerations. In unoptimized virtual desktops, audio and video streams must be encoded, decoded, and rendered inside the virtual machine host before traversing the network, causing severe host CPU saturation and noticeable audio/video lag. Microsoft Teams overcomes this using media optimization (WebRTC redirection), which offloads real-time media processing directly to the user’s local physical endpoint. Through the CsTeamsVdiPolicy PowerShell cmdlets, administrators can govern VDI optimization policies, media fallback behaviour, and endpoint features tenant-wide.

Understanding Teams VDI Media Optimization Architecture

Teams media optimization relies on a dual-engine architecture consisting of the Teams desktop client running in the virtual desktop and a lightweight WebRTC Media Engine running on the physical endpoint:

  • Signalling and UI: Chat, presence, meeting controls, and UI rendering execute inside the hosted virtual desktop environment.
  • Media Offload (Peer-to-Peer): Real-time media (microphone audio, camera video, screen sharing) is captured and encrypted directly on the physical client device, establishing point-to-point connections with Microsoft 365 media relays or peer endpoints without hairpinning traffic through the VDI data centre.
  • Policy Governance: CsTeamsVdiPolicy dictates whether users are permitted to run in optimized mode, how the client behaves when connecting from unsupported local devices, and whether fallback audio/video processing is allowed.

Connecting to Microsoft Teams PowerShell

Ensure you have the latest Microsoft Teams PowerShell module installed and connect using an account with Teams Administrator or Global Administrator privileges:

# Import and connect to Microsoft Teams PowerShell
Import-Module MicrosoftTeams
Connect-MicrosoftTeams

Confirm the presence of cmdlets dedicated to VDI policy management:

# Inspect available VDI policy cmdlets
Get-Command *CsTeamsVdiPolicy*

Inspecting Default VDI Optimization Policies

By default, Microsoft Teams tenants contain a Global VDI policy that governs all users who do not have an explicit custom policy assignment. Retrieve the Global policy configuration:

# Retrieve the Global VDI policy settings
Get-CsTeamsVdiPolicy -Identity Global

Key configuration attributes include:

  • Identity: The scope or name of the policy (e.g., Global or a custom string identifier).
  • VDIComponents: Governs which VDI components and redirection channels are activated for media offload.
  • DisableCallsAndMeetingsFallback: Controls whether users can initiate or join meetings if their local endpoint does not support VDI media offloading or lacks the WebRTC redirection service.

Creating Custom VDI Policies for Secure Environments

In highly regulated environments—such as financial call centres or healthcare platforms—you may want to prevent users from conducting unoptimized calls inside the virtual machine, which could degrade multi-session host performance and introduce audio latency.

Use New-CsTeamsVdiPolicy to create a strict optimization policy:

# Create a custom VDI policy that blocks unoptimized fallback calls
New-CsTeamsVdiPolicy -Identity "Strict-VDI-OptimizedOnly" `
    -DisableCallsAndMeetingsFallback $true

With this policy active, if a user logs into their virtual desktop from an unmanaged thin client that lacks the Citrix Workspace app or VMware Horizon Teams optimization pack, Teams informs the user that audio and video calling is disabled until they connect from a certified endpoint.

Conversely, for environments where operational continuity supersedes host performance, allow fallback processing:

# Create a policy allowing fallback audio/video processing inside the VM
New-CsTeamsVdiPolicy -Identity "Flexible-VDI-AllowFallback" `
    -DisableCallsAndMeetingsFallback $false

Modifying Existing VDI Policy Settings

If you need to adjust fallback restrictions on an existing custom policy or the tenant Global baseline, execute Set-CsTeamsVdiPolicy:

# Update the Global policy to enforce optimized media redirection
Set-CsTeamsVdiPolicy -Identity Global -DisableCallsAndMeetingsFallback $true

# Verify updated policy attributes
Get-CsTeamsVdiPolicy -Identity Global | Format-List Identity, DisableCallsAndMeetingsFallback

Assigning VDI Policies to Specific Users or Groups

Custom VDI policies can be granted directly to individual accounts or mapped across security groups representing specific virtual desktop pools:

1. Assigning Policy to Individual Users

# Grant custom VDI policy to a target administrator or test account
Grant-CsTeamsVdiPolicy -Identity "[email protected]" -PolicyName "Strict-VDI-OptimizedOnly"

# Verify policy assignment on the user object
Get-CsUserPolicyAssignment -Identity "[email protected]" | Where-Object { $_.PolicyType -eq "TeamsVdiPolicy" }

2. Assigning Policy to Microsoft Entra Security Groups

# Assign VDI policy to an entire Azure Virtual Desktop user group
Grant-CsTeamsVdiPolicy -Group "5b8f9e21-0a44-42b7-a3a8-4e892cfa712a" `
    -PolicyType TeamsVdiPolicy `
    -PolicyName "Strict-VDI-OptimizedOnly" `
    -Rank 1

Auditing and Verifying VDI Optimization on the Client

To verify whether a running Teams session inside a virtual desktop is successfully offloading media, users and administrators can inspect the client’s internal diagnostic status:

  1. Inside the remote desktop session, click the Settings and more (…) button next to the user profile avatar.
  2. Select About > Version.
  3. The banner banner at the top of the window will display one of the following optimization states:
    • AVD Media Optimized: Audio and video are actively offloaded to the Windows App / Remote Desktop client.
    • Citrix HDX Optimized: Media streams are handled by the Citrix HDX RealTime optimization pack.
    • VMware Horizon Media Optimized: Media streams are handled by the Horizon Virtual Channel.
    • Media Not Optimized: Media processing is executing within the VM (or blocked according to policy).

Removing Custom VDI Policies

Before deleting a custom VDI policy, unassign it from any individual users or security groups:

# Revoke policy from user and fall back to Global policy
Grant-CsTeamsVdiPolicy -Identity "[email protected]" -PolicyName $null

# Delete the custom VDI policy
Remove-CsTeamsVdiPolicy -Identity "Strict-VDI-OptimizedOnly" -Confirm:$false

Implementing targeted VDI policies via CsTeamsVdiPolicy ensures predictable host virtualisation performance, protects multi-session compute resources, and guarantees crisp, low-latency collaboration for remote workers.

Get the best tech tips delivered straight to your inbox.

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