Enable remote desktop or remote administration remotely

3

2

I recently reformatted one of my computers and had forgotten to turn on Remote Desktop. Now I am trying to grab some files off that computer, but I have no way of accessing it. I have an administrative account and can access the local network (remote desktop another computer that is on the network), but I can't figure out how too enable remote desktop or administration.

I found this post promising, but since remote administration wasn't on I wasn't able to enable Remote Desktop.

How can I enable Remote Desktop on a Windows 8 computer from another Windows 7 computer on the same local network?

Nick

Posted 2013-03-18T16:56:21.857

Reputation: 1 471

Seems like it would be a security risk if it was possible. – Brad Patton – 2013-03-18T16:58:36.867

Yes, I agree. I was just thinking if I have the user name and password maybe that could be used to verify the person. – Nick – 2013-03-18T17:00:20.533

It's a Catch-22 - you need remote desktop to turn on remote desktop. Unless you have an ssh server running, you'll need physical access to the machine... – MattDMo – 2013-03-18T17:10:05.440

Answers

5

The post you linked mentioned using PSEXEC from the Sysinternals Suite. Assuming you have valid admin credentials for the remote machine and can talk to it over the network, then it should work fine for running commands and applications on the machine.

Another post shows how to edit the required registry key via the command line. You can use PSEXEC to run that command on the remote computer. This would look like:

psexec \\<computer name or ip address> -u <username> -p <password> reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f

The remote PC will need to be rebooted too, as always PSEXEC can handle that too:

psexec \\<computer name or ip address> -u <username> -p <password> shutdown -r -t 0

Windos

Posted 2013-03-18T16:56:21.857

Reputation: 10 080

Do you even need to do all the PSEXEC stuff? We've had experience that you can open regedit from your Windows 7 machine -> click File -> Connect Network Registry.... This should then allow you to connect to the remote computer's registry to browse to the required key as above? – Kinnectus – 2014-06-30T07:33:51.250

2@BigChris you could indeed, there is a few caveats though the biggest one being that you need to be logged in as a user that is an admin on both computers. This isn't a massive deal in a domain environment (at least not where I work), but could be a hurdle in a workgroup environment. Using psexe, you specify the credentials for the remote machine so you don't need to worry about the account you use on your end.

Also doing it from the command line make it easily script/loop-able to do a number of machines at the same time (or in sequence.) – Windos – 2014-08-09T01:29:23.043

One might also need to add firewall rules, see my other answer (which you're welcome to crib from and fold into this one @Windos). – matt wilkie – 2018-07-12T17:33:40.517

2

Try (from elevated command prompt)

reg add \\<MachineName>\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f

Or

Start --> Run --> regedit --> OK

Connect Network Registry option under the File menu

Browse Active Directory to locate the remote server

Now browse HKLM on to find the following Registry key

HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server

Under the Terminal Server key, you'll find a REG_DWORD value named

fDenyTSConnection

. Double-click on that value to open the Edit DWORD Value box and change the value data from 1 (Remote Desktop disabled) to 0 (Remote Desktop enabled)

pulsarjune

Posted 2013-03-18T16:56:21.857

Reputation: 1 242

0

Extending @windos answer to add firewall rules and wrap in a short script:

setlocal
set .h=\\Machine9999
psexec %.h% reg add "hklm\system\currentcontrolset\control\terminal server" ^
  /f /v fDenyTSConnections /t REG_DWORD /d 0
psexec %.h% netsh firewall set service remoteadmin enable
psexec %.h% netsh firewall set service remotedesktop enable
endlocal

Script assumes current user has remote admin credentials, add -u and -p to adjust if needed. I haven't found the reboot to be necessary in our environment. Most recently tested on Win10 Enterprise x64.

Other sources:

matt wilkie

Posted 2013-03-18T16:56:21.857

Reputation: 4 147