Remote Desktop (former Terminal Services) listening port is defined in registry:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber