Monday, October 20, 2014

Enabling remote desktop on remote computer

I went home and forgot to enable remote desktop on my PC at my office, luckily i found couple of articles that is talking about enabling remote desktop remotely.

I followed the steps from  here and did a restart for the remote machine, but it didn't work, then i figured that since i did it through registry, firewall rules wasn't updated to allow it, while if i enabled remote desktop connections through the UI, it is updated automatically.

I found another article that has the same steps plus updating the firewall to enable remote desktop connections with a command line that is executed remotely. Another article for opening the firewall for remote desktop connections from command line.

The only thing that i have done extra is that i started the elevated command prompt for "psexec", the normal one didn't do the job.

Brief of the steps:
1- From the registry, connect to the remote computer
2- Change the key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\fDenyTSConnections from 1 to 0
3- Restart the remote machine by shutdown -m \\MachineName -r
4- Update the firewall rules on the remote machine by downloading psexec and running the below from elevated command prompt
psexec \\remote_machine_name cmd
Then after it connects
netsh advfirewall firewall set rule group=”remote desktop” new enable=Yes