Enable Or Disable Remote Desktop Via Command Prompt/PowerShell

0
50
Enable Or Disable Remote Desktop

Do you want to enable or disable Remote Desktop via Command Prompt/PowerShell? If you try to use the Remote Desktop feature without moving to the Windows Settings panel, then you can turn on Remote Desktop via Command Prompt or Windows PowerShell. After having a remote desktop client on your android or another PC, you can easily connect it and use your computer remotely.

Remote Desktop is an amazing facility of Windows PCs that allows you to connect two PCs or mobile so that a user can access another PC remotely. You can also resolve some issues on the PC through mobile or do other jobs according to your need. Also, you want a Remote Desktop client like Microsoft Remote Desktop or your mobile to connect two devices.

You can also turn on or off Remote Desktop Windows Settings. You want to move to System > Remote Desktop to access the option. However, let’s suppose that the Windows Settings panel is not opening because of some reasons, and you want to enable the Remote Desktop feature. Then you can use the below-mentioned way or trick to start the Remote Desktop using the command line.

Enable Or Disable Remote Desktop Via Command Prompt/PowerShell

 Remote Desktop

Turn On/Enable Remote Desktop Via Command Line

If you want to turn on Remote Desktop using Command Prompt and Windows PowerShell, follow the instructions given below:

Step 1:

Head over to the Command Prompt or PowerShell with administrator privilege

Step 2:

The set the value of fDenyTSConnections REG DWORD to 0

Step 3:

You can then add a Firewall rule

Step 4:

Restart your PC

Step 5:

Begin using Remote Desktop in Windows 10.

The commands are not similar for Command Prompt and Windows PowerShell.

Turn On RDP Firewall Via Command Prompt

Step 1:

If you want to get begin, head over to the Command Prompt with administrator privilege.

Step 2:

You can also look for it in the Taskbar search box, and tap the Run as administrator option that you see on your screen.

Step 3:

After that, input this following command and press Enter:

reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f

The value of fDenyTSConnections is set to 1 by default. This command will modify the value to 0.

Step 4:

Then, run the following command:

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

However, the command will update and add 3 rules in the Firewall so that you can begin using the Remote Desktop.

Turn On RDP Via Windows PowerShell

Follow the steps to turn on RDP through Windows PowerShell:
Step 1:

You want to open the Windows PowerShell using the administrator rights and input the following command and press Enter:

Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server'-name "fDenyTSConnections" -Value 0
Step 2:

This command will modify the fDenyTSConnections value to 0. Now, you want to run the following command to add rules in the Firewall:

Enable-NetFirewallRule -DisplayGroup "Remote Desktop"

That’s all!

Now you’ll be able to use Remote Desktop in Windows 10.

In case if you like to turn off Remote Desktop via Command Prompt and Windows PowerShell, you want to type these instructions.

Turn Off Remote Desktop Via Command Prompt or PowerShell

Turn Off Remote Desktop

If you want to turn off disable Remote Desktop using Command Prompt and Windows PowerShell, follow the steps mentioned below:

Step 1:

Head over to the Command Prompt or PowerShell with administrator privilege

Step 2:

Then set the value of fDenyTSConnections REG DWORD as 1

Step 3:

Add a Firewall rule

Step 4:

Restart your PC.

If you want to know more, then dive down below!

Turn Off Remote Desktop Via Command Prompt

If you want to turn off disable Remote Desktop using Command Prompt then follow the steps mentioned below:

Step 1:

Just try to set the default value of fDenyTSConnections as 1. For that, use this command-

reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 1 /f
Step 2:

Now you want to erase rules from the Firewall. For that, simply use the command:

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

Turn Off Remote Desktop Via PowerShell

If you want to turn off disable Remote Desktop using Power Shell then follow the steps mentioned below:

Step 1:

You want to modify the value of fDenyTSConnections as 1. You can also do that by using this command-

Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server'-name "fDenyTSConnections" -Value 1
Step 2:

The other command will allow you to erase the rules from the Firewall:

Disable-NetFirewallRule -DisplayGroup "Remote Desktop"

That’s all!

Conclusion:

I hope this simple article will be helpful for you. If it is helpful for you then share it with others. Also, if you want to know more about it then let us know in the comment section below!

Also Read:

Leave a Reply