The below instructions explain how to change the RDP port in Windows Server. This is often useful to stop bots brute forcing which can often result in a user being locked.
1. Start the Registry Editor (search "regedit")
2. Click the following registry subkey:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber
3. Choose Modify in the context menu and select Decimal.
4. Enter the new port number and click OK.
5. Close the Registry Editor
6. Open the new port in Windows firewall
7. Restart RDP:
To activate this new port , press Windows+R on keyboard which opens up run window. Type services.msc in run window and press enter, now restart “Remote Desktop Services” from Services list