Windows: How to change Windows RDP Port Number

To change your Windows RDP (Remote Desktop Protocol) port number to other,

1. Open Registry Editor,

C:\> regedit

2. Navigate to,

HKEY_LOCAL_MACHINE -> System -> CurrentControlSet -> Control ->Terminal Server -> WinStations -> RDP-Tcp

3. Look at “Port number” and select Decimal.

4. Change to any number that you need and perform a reboot if it is not apply immediately.

Howto: Change Windows Server 2003 RDP Port

By default, Windows Terminal Server and Remote Desktop Protocol (RDP) listen on TCP port 3389.

To change the port to your custom port, you may refer to below:-

1. Open the registry editor.
2. Navigate to,

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp

3. Find the “PortNumber” and change to your needed port.

To be secure, reboot your server to apply new port.

Tasklist & Taskkill

As a system administrator, tasklist and taskkill are very important where you could manage them easily from a remote server without access to the remote desktop.

Sometimes, you might suffer from a server highload, you may list the process task list from tasklist from another server,

tasklist /s system /u username /p password

Eg. tasklist /s myserver /u administrator /p mypassword

Next, you may perform a task killing from the taskkill command.

taskkill /f /im process /s system

Eg, taskkill /f /im php-cgi.exe /s myserver

Result:
SUCCESS: The process “php-cgi.exe” with PID 4020 has been terminated.