3

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?

3
  • Seems like it would be a security risk if it was possible. Mar 18, 2013 at 16:58
  • 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
    Mar 18, 2013 at 17:00
  • 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
    Mar 18, 2013 at 17:10

3 Answers 3

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
3
  • 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
    Jun 30, 2014 at 7:33
  • 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
    Aug 9, 2014 at 1:29
  • 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). Jul 12, 2018 at 17:33
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)

1

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:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .