Windows server 2019 / Remote Desktop Gateway - cannot change tcp port

Copper Contributor

Hi,
We've tried this on 2 different Windows 2019 installs (fully updated) : with Remote Desktop Gateway feature enabled. Using the RD Gateway manager, in Transport Settings, we try to change the default port number from default TCP 443 to something else, but we get the following error message : "The following error(s) occurred: Unable to set transport settings"

I've seen here and there some other people had the same problem, but I couldn't find any helpful solution... 
Any suggestion ?

2 Replies

@Thomas Lecroart 

Please run the following commands in an administrator powershell prompt:

                Import-Module RemoteDesktop

                Set-RDSessionCollectionConfiguration -CollectionName "YourCollectionName"-CustomRdpProperty "gatewayserver:s:yourgateway.domain.com:CustomPortYouWant"

 

Regards

BM

@Thomas Lecroart 

This problem took me way more time than it should have. Here is the complete solution :

 

Add Inbound Firewall rule for YourCustomPortValue

 

Regedit

[HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\TerminalServerGateway\Config\Core]

IsUdpEnabled REG_DWORD 0

 

Cmd

net stop tsgateway && net start tsgateway

 

Regedit 

[HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\TerminalServerGateway\Config\Core]

HttpsPort REG_DWORD (YourCustomPortValue)

 

Cmd

net stop tsgateway && net start tsgateway

 

Trying to do both registry changes at once will result in the tsgateway service to fail with a warning.