Skip to content

Instantly share code, notes, and snippets.

@melt7777
Created March 25, 2017 04:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save melt7777/2907b4894483efc14f5cb4365ccf7426 to your computer and use it in GitHub Desktop.
Save melt7777/2907b4894483efc14f5cb4365ccf7426 to your computer and use it in GitHub Desktop.
Enable RDP Connections on a specified port from an elevated Command Prompt on Windows 7/8/10/2008/2012
#############################################################
# ENABLE RDP CONNECTIONS ON SPECIFIED PORT FROM ELEVATED COMMAND PROMPT - WINDOWS 10
#############################################################
# example: for port 20000
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
netsh advfirewall firewall add rule name="rdp" dir=in action=allow protocol=TCP localport=20000
reg add "HKLM\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v PortNumber /t REG_DWORD /d 0x4e20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment