Enable Remote Desktop using Command Prompt or PowerShell

Enable Remote Desktop using Command Prompt or PowerShell

If you want to use the Remote office without opening the Windows Settings panel, you can activate Remote Desktop using the command prompt or Windows PowerShell. If you have a remote desktop client on your mobile or another computer, you can connect it and use your PC remotely.

Remote Desktop is a well-known feature of the Windows computer that allows you to connect two computers or a mobile so that an individual can access another computer remotely. You can solve some problems on the computer via mobile or perform other tasks as needed. You need a Remote Desktop client like Microsoft Remote Desktop or so on your mobile to connect two devices.

It is possible to activate to deactivate Windows Remote Desktop settings. You need to head to System> Remote Desktop to access the option. However, suppose that the Windows Settings panel does not open for some reason and that you need to activate the Remote Desktop function. You can then use this method to start Remote Desktop using the command line.

Activate remote desktop using the command line

To activate Remote Desktop using the Command Prompt and Windows PowerShell, follow these steps:

  1. Open Command Prompt or PowerShell with Administrator Privileges
  2. Set the value of fDenyTSConnections REG DWORD to 0
  3. Add a firewall rule
  4. Restart your computer
  5. Start using Remote Desktop in Windows 10.

The commands are not the same for the command prompt and Windows PowerShell.

1) Activate the RDP firewall using the command prompt

To get started, open the command prompt with administrator privileges. You can search for it in the search area of ​​the taskbar and click on the Run as administrator that appears on your screen. After that enter this following command and hit enter:

reg add "HKLMSYSTEMCurrentControlSetControlTerminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f

By default, the value of fDenyTSConnections is set to 1. This command will change the value to 0.

Then run the following command:

netsh advfirewall firewall set rule group="remote desktop" new enable=yes

This command will add and update three rules in the firewall so you can start using Remote Desktop.

2) Activate RDP using Windows PowerShell

You need to open Windows PowerShell with administrator privileges and enter the following command and press Enter:

Set-ItemProperty -Path 'HKLM:SystemCurrentControlSetControlTerminal Server'-name "fDenyTSConnections" -Value 0

This command will change the fDenyTSConnections value to 0. Now you need to run the following command to add rules to the firewall:

Enable-NetFirewallRule -DisplayGroup "Remote Desktop"

After that, you will be able to use Remote Desktop in Windows 10.

If you want to disable Remote Desktop using the command prompt and Windows PowerShell, you need to enter these steps.

Disable Remote Desktop using Command Prompt or PowerShell

To turn off Remote Desktop using the Command Prompt and Windows PowerShell, follow these steps:

  1. Open Command Prompt or PowerShell with Administrator Privileges
  2. Set the value of fDenyTSConnections REG DWORD to 1
  3. Add a firewall rule
  4. Restart the computer.

To learn more, you need to keep reading.

Disable the remote desktop using the command prompt

You must set the default value of fDenyTSConnections as 1. To do this, use this command-

reg add "HKLMSYSTEMCurrentControlSetControlTerminal Server" /v fDenyTSConnections /t REG_DWORD /d 1 /f

You should now remove the firewall rules. To do this, use this command-

netsh advfirewall firewall set rule group="remote desktop" new enable=No

Disable remote desktop using PowerShell

You must change the value of fDenyTSConnections as 1. You can do this using this command-

Set-ItemProperty -Path 'HKLM:SystemCurrentControlSetControlTerminal Server'-name "fDenyTSConnections" -Value 1

The second command will allow you to remove the firewall rules:

Disable-NetFirewallRule -DisplayGroup "Remote Desktop"

That’s it! I hope you find this simple tutorial useful.

Leave a Reply