Create QoS Group Policy Objects for Microsoft Teams using PowerShell! Now includes New Teams client and Microsoft Teams Rooms!!

**1-26-2024: Updates**

  • Added distinction between Teams Classic and New Teams throughout
  • New section added for creating new QoS GPO for the New Teams client and its own executable ms-Teams.exe
  • Removed “File Transfer” specific GPO entry and consolidated it into the Application Sharing entry
  • Updated consolidated script section to include classic Teams, New Teams, and Teams Rooms

**8-5-2020: Update – updated the Teams Room section to include the Teams.exe**

**9-23-2019: UPDATE – new section added for creating new QoS Group Policy Object for Microsoft Teams Room Systems!!**

**2-20-2018: UPDATE – if you are having issues with Windows 10 not marking packets, please see the bottom of this article for guidance**

This post and GPO scripts have been through a number of updates of the years and here comes another update to include the New Teams client. The classic Teams client is going end-of-life after March 31st, 2024 and the New Teams client will be the default going forward. The New Teams client has a different executable name (ms-Teams.exe) compared to the classic Teams client (Teams.exe). Thus, the reasoning on updating this post and script to include the new client but also updating the wording to “classic” Teams client since you may have a mixed environment for a short time. More info on the Teams client announcements https://techcommunity.microsoft.com/t5/microsoft-teams-blog/announcing-general-availability-of-the-new-microsoft-teams-app/ba-p/3934603

I have also updated the Teams Room sections to follow closer what the product is now called “Microsoft Teams Room” vs “Teams Room System”.

As always, the official Microsoft QoS documentation is available here

Lets get QoS’ing!!!

Lets go ahead and tackle how to mark QoS at the Windows operating system level. Always check with your network setup to ensure that the DSCP markings are honored and are of the right values in respect with your network configuration.

Again – I am giving Pat Richard @PatRichard  lots of credit as I used his Lync/Skype4B QoS Calculator Tool as a reference.

**Important Starting Note**
Teams allows you to customize which ports to use. If you have customized the client ports in the Teams Admin Center, you will need to make the appropriate changes to the commands below. To check what client ports you are using . To review your settings go to the Teams Admin Center > Meetings > Meeting Settings > Network section

https://admin.teams.microsoft.com/meetings/settings

The following commands leverage the Active Directory and Group Policy Management PowerShell modules, so make sure you have them installed prior.

#Retrieve the list of all the installed PowerShell Modules
Get-Module -ListAvailable

Microsoft New Teams client GPO

The following PowerShell commands create a new QoS Group Policy Object for the New Teams client as it has a different executable (.exe) than the classic client:

  • A new Active Directory Group Policy Object called “New Teams Client – QoS” is created in the default Group Policy Objects location
    • The name of this GPO is completely customizable to fit your naming conventions
  • Targets the Teams desktop client executable: ms-Teams.exe
  • Enables QoS for the computer’s TCP/IP network stack
  • Creates QoS entries for the following Teams communication types for the default ports.
    • Audio
      • Ports 50,000-50,019 (Source)
      • DSCP marking of 46
    • Video
      • Ports 50,020-50,039 (Source)
      • DSCP marking of 34
    • Application Sharing
      • Ports 50,040-50,059 (Source)
      • DSCP marking of 24
#Import the Powershell Module for Active Directory and Group Policy
Import-Module ActiveDirectory,GroupPolicy

#Create a new Group Policy Object (GPO) that will be applied to the Organizational Units (OU's) that contain the computer objects that will be used by Teams users with the New Teams client.
#The value "New Teams client - QoS" can be modified to fit your needs or naming standards
New-GPO -Name "New Teams Client - QoS" -Comment "QoS/DSCP markings for New Teams client media traffic. That contain the computer objects that will be used by the Teams users."

#Create Registry Value to enable TCP/IP QoS on the computer
Set-GPPrefRegistryValue -Name "New Teams Client - QoS" -Context Computer -Key "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\QoS" -ValueName "Do not use NLA" -Value "1" -Type String -Action Update

#Create Registry Value for New Teams client Audio QoS in the "New Teams Client - QoS" GPO
Set-GPRegistryValue -Name "New Teams Client - QoS" -Key "HKLM\SOFTWARE\Policies\Microsoft\Windows\QoS\New Teams Audio QoS - ms-Teams.exe" -ValueName "Version", "Application Name", "Protocol", "Local Port", "Local IP", "Local IP Prefix Length", "Remote Port", "Remote IP", "Remote IP Prefix Length", "DSCP Value", "Throttle Rate" -Type String -Value "1.0", "ms-Teams.exe", "*", "50000:50019", "*", "*", "*", "*", "*", "46", "-1"

#Create Registry Value for New Teams client Video QoS in the "New Teams Client - QoS" GPO
Set-GPRegistryValue -Name "New Teams Client - Qos" -Key "HKLM\SOFTWARE\Policies\Microsoft\Windows\QoS\New Teams Video QoS - ms-Teams.exe" -ValueName "Version", "Application Name", "Protocol", "Local Port", "Local IP", "Local IP Prefix Length", "Remote Port", "Remote IP", "Remote IP Prefix Length", "DSCP Value", "Throttle Rate" -Type String -Value "1.0", "ms-Teams.exe", "*", "50020:50039", "*", "*", "*", "*", "*", "34", "-1"

#Create Registry Value for New Teams client Application Sharing QoS in the "New Teams - QoS" GPO
Set-GPRegistryValue -Name "New Teams Client - Qos" -Key "HKLM\SOFTWARE\Policies\Microsoft\Windows\QoS\New Teams App Sharing QoS - ms-Teams.exe" -ValueName "Version", "Application Name", "Protocol", "Local Port", "Local IP", "Local IP Prefix Length", "Remote Port", "Remote IP", "Remote IP Prefix Length", "DSCP Value", "Throttle Rate" -Type String -Value "1.0", "ms-Teams.exe", "*", "50040:50059", "*", "*", "*", "*", "*", "24", "-1"

Microsoft Teams Classic client GPO

The following PowerShell commands create a new QoS Group Policy Object for the classic Teams client:

  • A new Active Directory Group Policy Object called “Classic Teams Client – QoS” is created in the default Group Policy Objects location
    • The name of this GPO is completely customizable to fit your naming conventions
  • Targets the Teams desktop client executable: Teams.exe
  • Enables QoS for the computer’s TCP/IP network stack
  • Creates QoS entries for the following Teams communication types for the default ports.
    • Audio
      • Ports 50,000-50,019 (Source)
      • DSCP marking of 46
    • Video
      • Ports 50,020-50,039 (Source)
      • DSCP marking of 34
    • Application Sharing
      • Ports 50,040-50,059 (Source)
      • DSCP marking of 24

#Import the Powershell Module for Active Directory and Group Policy
Import-Module ActiveDirectory,GroupPolicy

#Create a new Group Policy Object (GPO) that will be applied to the Organizational Units (OU's) that contain the computer objects that will be used by Teams users with classic client.
#The value "Teams client - QoS" can be modified to fit your needs or naming standards
New-GPO -Name "Classic Teams Client - QoS" -Comment "QoS/DSCP markings for Teams media traffic. That contain the computer objects that will be used by the Teams users with classic client."

#Create Registry Value to enable TCP/IP QoS on the computer
Set-GPPrefRegistryValue -Name "Classic Teams Client - QoS" -Context Computer -Key "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\QoS" -ValueName "Do not use NLA" -Value "1" -Type String -Action Update

#Create Registry Value for Skype4B client Audio QoS in the "Skype4B Client - QoS" GPO
Set-GPRegistryValue -Name "Classic Teams Client - QoS" -Key "HKLM\SOFTWARE\Policies\Microsoft\Windows\QoS\Teams classic Audio QoS - Teams.exe" -ValueName "Version", "Application Name", "Protocol", "Local Port", "Local IP", "Local IP Prefix Length", "Remote Port", "Remote IP", "Remote IP Prefix Length", "DSCP Value", "Throttle Rate" -Type String -Value "1.0", "Teams.exe", "*", "50000:50019", "*", "*", "*", "*", "*", "46", "-1"

#Create Registry Value for Skype4B client Video QoS in the "Skype4B Client - QoS" GPO
Set-GPRegistryValue -Name "Classic Teams Client - Qos" -Key "HKLM\SOFTWARE\Policies\Microsoft\Windows\QoS\Teams classic Video QoS - Teams.exe" -ValueName "Version", "Application Name", "Protocol", "Local Port", "Local IP", "Local IP Prefix Length", "Remote Port", "Remote IP", "Remote IP Prefix Length", "DSCP Value", "Throttle Rate" -Type String -Value "1.0", "Teams.exe", "*", "50020:50039", "*", "*", "*", "*", "*", "34", "-1"

#Create Registry Value for Skype4B client Application Sharing QoS in the "Skype4B Client - QoS" GPO
Set-GPRegistryValue -Name "Classic Teams Client - Qos" -Key "HKLM\SOFTWARE\Policies\Microsoft\Windows\QoS\Teams classic Application Sharing QoS - Teams.exe" -ValueName "Version", "Application Name", "Protocol", "Local Port", "Local IP", "Local IP Prefix Length", "Remote Port", "Remote IP", "Remote IP Prefix Length", "DSCP Value", "Throttle Rate" -Type String -Value "1.0", "Teams.exe", "*", "50040:50059", "*", "*", "*", "*", "*", "24", "-1"

Microsoft Teams Rooms (Windows)

The following PowerShell commands create a new QoS Group Policy Object for Microsoft Teams Rooms that run Windows:

  • A new Active Directory Group Policy Object called “Teams Room – QoS” is created in the default Group Policy Objects location
    • The name of this GPO is completely customizable to fit your naming conventions
  • Targets the Teams Room System: Microsoft.SkypeRoomSystem.exe
  • Enables QoS for the computer’s TCP/IP network stack
  • Creates QoS entries for the following Teams communication types for the default ports.
    • Audio
      • Ports 50,000-50,019 (Source)
      • DSCP marking of 46
    • Video
      • Ports 50,020-50,039 (Source)
      • DSCP marking of 34
    • Application Sharing
      • Ports 50,040-50,059 (Source)
      • DSCP marking of 24
#Import the Powershell Module for Active Directory and Group Policy
Import-Module ActiveDirectory,GroupPolicy

#Create a new Group Policy Object (GPO) that will be applied to the Organizational Units (OU's) that contain the computer objects that will be used by Teams Rooms.
#The value "Teams Room System - QoS" can be modified to fit your needs or naming standards
New-GPO -Name "Teams Room - QoS" -Comment "QoS/DSCP markings for Teams Room media traffic. That contain the computer objects of the Teams Rooms."

#Create Registry Value to enable TCP/IP QoS on the computer
Set-GPPrefRegistryValue -Name "Teams Room - QoS" -Context Computer -Key "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\QoS" -ValueName "Do not use NLA" -Value "1" -Type String -Action Update

#Create Registry Value for Teams Room Audio QoS in the "Teams Room - Qos" GPO
Set-GPRegistryValue -Name "Teams Room - QoS" -Key "HKLM\SOFTWARE\Policies\Microsoft\Windows\QoS\Teams Room Audio QoS - Teams Room.exe" -ValueName "Version", "Application Name", "Protocol", "Local Port", "Local IP", "Local IP Prefix Length", "Remote Port", "Remote IP", "Remote IP Prefix Length", "DSCP Value", "Throttle Rate" -Type String -Value "1.0", "Microsoft.SkypeRoomSystem.exe", "*", "50000:50019", "*", "*", "*", "*", "*", "46", "-1"

#Create Registry Value for Teams Room Video QoS in the "Teams Room - Qos" GPO
Set-GPRegistryValue -Name "Teams Room - Qos" -Key "HKLM\SOFTWARE\Policies\Microsoft\Windows\QoS\Teams Room Video QoS - Teams Room.exe" -ValueName "Version", "Application Name", "Protocol", "Local Port", "Local IP", "Local IP Prefix Length", "Remote Port", "Remote IP", "Remote IP Prefix Length", "DSCP Value", "Throttle Rate" -Type String -Value "1.0", "Microsoft.SkypeRoomSystem.exe", "*", "50020:50039", "*", "*", "*", "*", "*", "34", "-1"

#Create Registry Value for Teams Room Application Sharing QoS in the "Teams Room - Qos" GPO
Set-GPRegistryValue -Name "Teams Room - Qos" -Key "HKLM\SOFTWARE\Policies\Microsoft\Windows\QoS\Teams Room Application Sharing QoS - Teams Room.exe" -ValueName "Version", "Application Name", "Protocol", "Local Port", "Local IP", "Local IP Prefix Length", "Remote Port", "Remote IP", "Remote IP Prefix Length", "DSCP Value", "Throttle Rate" -Type String -Value "1.0", "Microsoft.SkypeRoomSystem.exe", "*", "50040:50059", "*", "*", "*", "*", "*", "24", "-1"

Microsoft Teams Classic, New Teams, & Teams Rooms Consolidated GPO

If you want to combine the GPO for the classic Teams client, New Teams client, and Teams Rooms, the following PowerShell commands will create a single QoS Group Policy Object to include all three
(I have removed the additional comments for simplicity)

  • A new Active Directory Group Policy Object called “Teams Classic, New Teams, & Room System – QoS” is created in the default Group Policy Objects location
    • The name of this GPO is completely customizable to fit your naming conventions
  • Targets the following client executables:
    • Classic Teams client: Teams.exe
    • New Teams client: ms-Teams.exe
    • Teams Rooms: Microsoft.SkypeRoomSystem.exe  and 
  • Enables QoS for the computer’s TCP/IP network stack
  • Creates QoS entries for the following Teams communication types for the default ports.
    • Audio
      • Ports 50,000-50,019 (Source)
      • DSCP marking of 46
    • Video
      • Ports 50,020-50,039 (Source)
      • DSCP marking of 34
    • Application Sharing
      • Ports 50,040-50,059 (Source)
      • DSCP marking of 24
Import-Module ActiveDirectory,GroupPolicy

New-GPO -Name "Teams Clients and Teams Rooms - QoS" -Comment "QoS/DSCP markings for classic Teams clients, New Teams clients, and Teams Rooms media traffic."

Set-GPPrefRegistryValue -Name "Teams Clients and Teams Rooms - QoS" -Context Computer -Key "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\QoS" -ValueName "Do not use NLA" -Value "1" -Type String -Action Update


#Teams Room
Set-GPRegistryValue -Name "Teams Clients and Teams Rooms - QoS" -Key "HKLM\SOFTWARE\Policies\Microsoft\Windows\QoS\Teams Room Audio QoS - Teams Room.exe" -ValueName "Version", "Application Name", "Protocol", "Local Port", "Local IP", "Local IP Prefix Length", "Remote Port", "Remote IP", "Remote IP Prefix Length", "DSCP Value", "Throttle Rate" -Type String -Value "1.0", "Microsoft.SkypeRoomSystem.exe", "*", "50000:50019", "*", "*", "*", "*", "*", "46", "-1"
Set-GPRegistryValue -Name "Teams Clients and Teams Rooms - QoS" -Key "HKLM\SOFTWARE\Policies\Microsoft\Windows\QoS\Teams Room Video QoS - Teams Room.exe" -ValueName "Version", "Application Name", "Protocol", "Local Port", "Local IP", "Local IP Prefix Length", "Remote Port", "Remote IP", "Remote IP Prefix Length", "DSCP Value", "Throttle Rate" -Type String -Value "1.0", "Microsoft.SkypeRoomSystem.exe", "*", "50020:50039", "*", "*", "*", "*", "*", "34", "-1"
Set-GPRegistryValue -Name "Teams Clients and Teams Rooms - QoS" -Key "HKLM\SOFTWARE\Policies\Microsoft\Windows\QoS\Teams Room Application Sharing QoS - Teams Room.exe" -ValueName "Version", "Application Name", "Protocol", "Local Port", "Local IP", "Local IP Prefix Length", "Remote Port", "Remote IP", "Remote IP Prefix Length", "DSCP Value", "Throttle Rate" -Type String -Value "1.0", "Microsoft.SkypeRoomSystem.exe", "*", "50040:50059", "*", "*", "*", "*", "*", "24", "-1"



#Teams Classic
Set-GPRegistryValue -Name "Teams Clients and Teams Rooms - QoS" -Key "HKLM\SOFTWARE\Policies\Microsoft\Windows\QoS\Teams classic Audio QoS - Teams.exe" -ValueName "Version", "Application Name", "Protocol", "Local Port", "Local IP", "Local IP Prefix Length", "Remote Port", "Remote IP", "Remote IP Prefix Length", "DSCP Value", "Throttle Rate" -Type String -Value "1.0", "Teams.exe", "*", "50000:50019", "*", "*", "*", "*", "*", "46", "-1"
Set-GPRegistryValue -Name "Teams Clients and Teams Rooms - QoS" -Key "HKLM\SOFTWARE\Policies\Microsoft\Windows\QoS\Teams classic Video QoS - Teams.exe" -ValueName "Version", "Application Name", "Protocol", "Local Port", "Local IP", "Local IP Prefix Length", "Remote Port", "Remote IP", "Remote IP Prefix Length", "DSCP Value", "Throttle Rate" -Type String -Value "1.0", "Teams.exe", "*", "50020:50039", "*", "*", "*", "*", "*", "34", "-1"
Set-GPRegistryValue -Name "Teams Clients and Teams Rooms - QoS" -Key "HKLM\SOFTWARE\Policies\Microsoft\Windows\QoS\Teams classic App Sharing QoS - Teams.exe" -ValueName "Version", "Application Name", "Protocol", "Local Port", "Local IP", "Local IP Prefix Length", "Remote Port", "Remote IP", "Remote IP Prefix Length", "DSCP Value", "Throttle Rate" -Type String -Value "1.0", "Teams.exe", "*", "50040:50059", "*", "*", "*", "*", "*", "24", "-1"


#New Teams
Set-GPRegistryValue -Name "Teams Clients and Teams Rooms - QoS" -Key "HKLM\SOFTWARE\Policies\Microsoft\Windows\QoS\New Teams Audio QoS - ms-Teams.exe" -ValueName "Version", "Application Name", "Protocol", "Local Port", "Local IP", "Local IP Prefix Length", "Remote Port", "Remote IP", "Remote IP Prefix Length", "DSCP Value", "Throttle Rate" -Type String -Value "1.0", "ms-Teams.exe", "*", "50000:50019", "*", "*", "*", "*", "*", "46", "-1"
Set-GPRegistryValue -Name "Teams Clients and Teams Rooms - QoS" -Key "HKLM\SOFTWARE\Policies\Microsoft\Windows\QoS\New Teams Video QoS - ms-Teams.exe" -ValueName "Version", "Application Name", "Protocol", "Local Port", "Local IP", "Local IP Prefix Length", "Remote Port", "Remote IP", "Remote IP Prefix Length", "DSCP Value", "Throttle Rate" -Type String -Value "1.0", "ms-Teams.exe", "*", "50020:50039", "*", "*", "*", "*", "*", "34", "-1"
Set-GPRegistryValue -Name "Teams Clients and Teams Rooms - QoS" -Key "HKLM\SOFTWARE\Policies\Microsoft\Windows\QoS\New Teams App Sharing QoS - ms-Teams.exe" -ValueName "Version", "Application Name", "Protocol", "Local Port", "Local IP", "Local IP Prefix Length", "Remote Port", "Remote IP", "Remote IP Prefix Length", "DSCP Value", "Throttle Rate" -Type String -Value "1.0", "ms-Teams.exe", "*", "50040:50059", "*", "*", "*", "*", "*", "24", "-1"

UPDATE – If you are having trouble with Windows 10 not marking packets even though all the registry keys are configured properly. There is an additional setting in the GPO that needs to be selected to allow the you to control the DSCP marking. 

  • Go to the GPO Editor and navigate to Computer Configuration > Policies > Windows Settings
  • Right-click Policy-Based QoS > choose Advanced QoS Settings …
  • Go to the DSCP Marking Override tab
  • Check Control DSCP Marking requests from applications and services
  • Select Allowed

One thought on “Create QoS Group Policy Objects for Microsoft Teams using PowerShell! Now includes New Teams client and Microsoft Teams Rooms!!

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.