- First, permit RDP through the firewall.
netsh advfirewall firewall set rule group="remote desktop" new enable=Yes
- Then, enable terminal services in the registry using the reg command:
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
- Done!
To disable Remote Desktop access is just as easy:
- First, deny RDP through the firewall.
netsh advfirewall firewall set rule group="remote desktop" new enable=No
- Then, disable terminal services in the registry using the reg command:
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 1 /f
- Done!
Please note, you may need to reboot the windows machine for the changes to take effect (though problably not), and this doesn't work on "home" editions of Windows.