Wednesday, October 7, 2009

How to change the Remote Desktop listening port on Windows Vista!

This will work with Sever 2003 and XP.

1.Open up the Windows Registry Editor and browse to this Registry path:


HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp2.Locate the PortNumber Registry key on the right-pane, double-click to open, click the Decimal option in the Base section, enter 443 in the text box and click OK (change 443 to the port number of your need).

Take note that:

The new TCP port for Remote Desktop service must not currently in used. To confirm the TCP port 443 is free or unused, type

netstat -an
find "443"

At the Command Prompt window. If there is no output from the netstat command, meaning that the TCP 443 port number is not in used (and thus available for new RDP listening port).

If you’re not comfortable with Windows Registry Editor, you can simply copy and paste the following Console Registry Tool command (Reg.exe) to an elevated Command Prompt window in Windows Vista:

You might need to download Reg.exe from Microsoft if it’s not currently in your Windows.
REG ADD "HKLM\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v PortNumber /t REG_DWORD /d 443 /f
To change back to the default, simply replace the PortNumber Registry key (in this case, TCP 443) to TCP port 3389.
How to restart Windows Remote Desktop service after changing its listening port?
There are at least two ways to enable/disable or restart Remote Desktop service – Group Policies or System Properties:
Using Group Policies (i.e. gpedit.msc)
1.Click the Vista Orb, type gpedit.msc in the Start Search text box (Vista Instant Search) and double-click the “gpedit” in the Program list
2.For Windows XP SP2:

In Computer Configuration, Administrative Templates, Windows Components, Terminal Services, double-click the Allows users to connect remotely using Terminal Services setting.
For Windows Vista Ultimate:
In Computer Configuration, Administrative Templates, Windows Components, Terminal Services, Terminal Server, Connections, double-click the Allows users to connect remotely using Terminal Services setting.
3.Click Disable to deactivate Remote Desktop and then click Enable to reactivate the service again.
Using System Properties dialog box

If the “Allows users to connect remotely using Terminal Services” Group Policy setting is set to “Not Configured”, the “Enable Remote Desktop on this computer” setting (on the Remote tab of the System Properties dialog box) takes precedence. Otherwise, the “Allows users to connect remotely using Terminal Services” Group Policy setting takes precedence.

0 comments:

Post a Comment