Have you ever been away from your work PC, tried to Remote Desktop (RDP/mstsc) into it, only to realize that you’ve forgotten to enable RDP before you left work? Ever shake your head at the irony that if you could only remote in, you could enable RDP?
Well now you can:
The simplest way is to run a free tool:
If you’d prefer to not run an unknown tool and give it admin access to your remote machine, you can do it by hand:
- Fire up regedit.exe on your local machine.
- File -> Connect Network Registry -> your remote machine name for which you have admin access.
- File -> Import… -> and import the following file:
Windows Registry Editor Version 5.00
- Reboot your remote machine:
shutdown \\yourremotemachine /f /r /t 0
If you can use WMI you can use the Win32_TerminalServiceSetting class in the root\cimv2\TerminalServices namespace. The SetAllowTSConnections method will allow you to enable the ts connections. You will need to set both the AllowTSConnections and the ModifyFirewallException params to 1.
I’m not sure how to use WMI myself. If someone know how to please comment.