Remote Desktop (RDP) Tricks and Tips
Modify Remote Desktop Listening Port
- Run regedit (Registry Editor)
- Locate and then click the following registry subkey:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber
- Double-click on the PortNumber to modify the RDP port number
- Select the Decimal base and modify the value data for the PortNumber. Default is 3389. The value should be within between 1025 and 65535
- Click OK and quit Registry Editor.
- Reboot the computer or restart “Remote Desktop Services service”
Connect to remote desktop using different port
If you want to connect to remote desktop using customized port number (default is 3389)
- Run mstsc (optional steps: Click Start, click All Programs – Accessories – Communications – Remote Desktop Connection)
- In the Computer box, enter the IP address or host name for the computer that you need to connect and then follow by a colon “:” together with the port number
- Below are some of the example:
Example 1: MyServer is the host name and 3388 is the customized port number
MyServer:3388 |
Example 2: 192.168.1.10 is the IP address of the computer and 3390 is the customized port number
192.168.1.10:3390 |
- Click Connect.
Alternatively, you can use the follow command:
mstsc /v:servername:portnumber
Example: mstsc /v:MyServer:3388
Activate Remote Desktop remotely using registry editor
Enable Remote desktop via the registry
- Run regedit (Registry Editor)
- On the File menu, click Connect Network Registry.
- In the Select Computer dialog box, type the computer name and then click Check Names.
- In the Enter Network Password dialog box, provide Domain Admins credentials for the domain of the server, and then click OK.
- After the computer name resolves, click OK.
- Locate the following registry subkey in the computer node:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server
- Double-click on the fDenyTSConnection to edit the DWORD value. Change the value data from 1 (Remote Desktop disabled) to 0 (Remote Desktop enabled)
- Restart the computer. (You can restart the remote computer using “shutdown /m \\computername /r”
Multiple RDP session for single user
By default, Remote Desktop (RDP)/Terminal Services in Windows 2008 will be using the same RDP session if you are using the same username. Unlike Windows 2003 that you can have different session under same user name. Below are the registry key to allow multiple RDP session for single user in Windows 2008
- Run regedit (Registry Editor)
- Locate and then click the following registry subkey:
- HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer
- If the fSingleSessionPerUser value doesn’t exist, create a new DWORD value named fSingleSessionPerUser
- Modify fSingleSessionPerUser value:
0 Allow multiple sessions per user
1 Force each user to a single session
- Click OK and quit Registry Editor.
- Restart “Remote Desktop Services service” or Reboot the computer
RDP to the console session
In certain case, we need to connect to the console session of the server so that we can start/monitor certain legacy application that is not started via Windows Services. The administrator needs to login the server first and only start the application manually.
Use the following command to remote desktop to the server into console session:
For Windows Vista, 7, 2008 , Windows XP SP2 and above
Mstsc /admin
For Windows XP SP1 and before:
Mstsc /console
Resource and References:
http://oreilly.com/windows/archive/server-hacks-remote-desktop.html
http://support.microsoft.com/kb/306759
http://support.microsoft.com/kb/304304
http://remotedesktoprdp.com/Force-Single-Session-Allow-Multiple-Sessions-Per-User.aspx