Open in the explorer

Use port range for RDP Shortpath for unmanaged networks

Type
Computer
GPO path
Computer Configuration › Policies › Administrative Templates › Azure Virtual Desktop
Supported on
Azure Virtual Desktop
ADMX file
terminalserver-avd.admx
Internal name
terminalserver-avd/AVD_SERVER_UDP_STUN_CLIENT_PORT_RANGE

Explanation

This policy setting allows you to specify the UDP port range the Azure Virtual Desktop client will use to communicate with the session host when RDP Shortpath for public networks is used.
If you enable this policy setting, the Azure Virtual Desktop client will randomly select the port from the range for every connection. If the specified port range is exhausted, the client's operating system will choose a port to use.
If you disable or do not configure this policy setting, the operating system on the client will select a port used for the session (recommended)

If you enable this policy setting, we recommend configuring firewall rules on the client to allow inbound UDP connection in this port range for Azure Virtual Desktop clients. If you do not configure firewall rules, Windows Defender Firewall may prompt the user to allow communication.
If you enable this policy setting, you can also customize a UDP port range for the Azure Virtual Desktop client.
When choosing the base and pool size, consider the number of ports setting to ensure that the upper bound does not exceed 49151. For example, if you select 38300 as a port base and 1000 as pool size, the upper bound will be 39299.

UDP port base:
This setting allows you to customize the base for the UDP port range. The default base port is 38300 (recommended). You can select any value in the 1024-49151 range for the base.

Port pool size:
This setting allows you to select how many ports will be in the UDP port range. Default (recommended) is 1000.

Registry

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services
Value name
ICEEnableClientPortRange
StateValue written
EnabledREG_DWORD = 1
DisabledREG_DWORD = 0

PowerShell

PowerShell commands that write to the registry what the policy would write. Values in angle brackets (<…>) must be replaced.

Writing directly to the registry bypasses Group Policy: if a GPO manages this value, it will be rewritten at the next gpupdate; otherwise the value stays in place (the "tattooing" effect). Prefer a GPO or, locally, LGPO.exe. Run PowerShell as administrator for HKLM. Some policies need a restart or gpupdate /force.

Enable

# Enable: terminalserver-avd/AVD_SERVER_UDP_STUN_CLIENT_PORT_RANGE
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'ICEEnableClientPortRange' -Value 1 -Type DWord
# UDP port base
Set-ItemProperty -Path $k -Name 'ICEClientPortBase' -Value '38300' -Type String  # between 1024 and 49151
# Port pool size
Set-ItemProperty -Path $k -Name 'ICEClientPortRange' -Value '1000' -Type String  # between 100 and 65535

Disable

# Disable: terminalserver-avd/AVD_SERVER_UDP_STUN_CLIENT_PORT_RANGE
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'ICEEnableClientPortRange' -Value 0 -Type DWord

Revert to "Not configured"

# Revert to "Not configured": terminalserver-avd/AVD_SERVER_UDP_STUN_CLIENT_PORT_RANGE
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services'
Remove-ItemProperty -Path $k -Name 'ICEEnableClientPortRange' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'ICEClientPortBase' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'ICEClientPortRange' -ErrorAction SilentlyContinue

Options (2)

LabelControlRegistry valueREG typeConstraints / details
UDP port basePart_ICEClientPortBaseNumeric boxdecimalICEClientPortBaseREG_SZ
Min: 1024 · Max: 49151 · Default (UI): 38300
Port pool sizePart_ICEClientPortRangeNumeric boxdecimalICEClientPortRangeREG_SZ
Min: 100 · Max: 65535 · Default (UI): 1000

Application

Azure Virtual Desktop (Microsoft) — November 2026 templates

Official templates downloaded on November 12, 2026.