Enable RDP Shortpath for managed network using NAT traversal
Explanation
This policy lets you control RDP Shortpath for managed networks. It's a direct UDP connection between a client device and session host using a private connection, such as ExpressRoute private peering or a virtual private network (VPN). When the RDP Shortpath listener isn't enabled on session hosts and an inbound port isn't allowed, ICE/STUN is used to discover available IP addresses and a dynamic port that can be used for a connection.
If you enable or do not configure the policy this policy setting, Remote Desktop Protocol will consider managed networks paths to establish connection with the session host.
If you disable this policy, Remote Desktop Protocol will NOT consider managed networks path to establish connection with the session host.
Registry
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services- Value name
directUDP
| State | Value written |
|---|---|
| Enabled | REG_DWORD = 1 |
| Disabled | REG_DWORD = 2 |
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_SHORTPATH_DIRECT
$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 'directUDP' -Value 1 -Type DWordDisable
# Disable: terminalserver-avd/AVD_SERVER_UDP_SHORTPATH_DIRECT
$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 'directUDP' -Value 2 -Type DWordRevert to "Not configured"
# Revert to "Not configured": terminalserver-avd/AVD_SERVER_UDP_SHORTPATH_DIRECT
$k = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services'
Remove-ItemProperty -Path $k -Name 'directUDP' -ErrorAction SilentlyContinueApplication
Azure Virtual Desktop (Microsoft) — November 2026 templates
Official templates downloaded on November 12, 2026.