The Windows Remote desktop can be enable with the command line such as CMD and Powershell. Here we enable remote desktop using command prompt in Windows 10. You can use this method on all Microsoft Windows server and Workstation systems.
In Microsoft Windows operating systems, you can connect to a computer running Windows from another computer running Windows that’s connected to the same network or the Internet. For example, you can use all of your work computer’s programs, files, and network resources from your home computer, and it’s just like you’re sitting in front of your computer at work.
To connect to a remote computer, that computer must be turned on; it must have a network connection, Remote Desktop must be enabled. You must have network access to the remote computer (this could be through the Internet), and you must have permission to connect. For permission to connect, you must be on the list of remote desktop users. Before you start a connection, it’s a good idea to look up the name of the computer you’re connecting to and to make sure Remote Desktop connections are allowed through its firewall.
Enable Remote Desktop using Command Line
To enable remote desktop using command line, you must have administrator permission in Windows. The command line interfaces, command prompt or Powershell, must run as administrator.
Enable remote desktop process:
- Run Windows Command Prompt.
- Execute registry command to enable remote desktop.
- Enable Remote Desktop on system Firewall.
- Test Remote Desktop Connectivity between two systems.
Let’s run the command prompt as administrator and follow the article to enable remote desktop with command line.
1. Type the below command to enable remote desktop.
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
The result must be the same as above screenshot. If you face any issue while running command, check the command structure and try again.
2. To disable remote desktop, just type the below command and run it.
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 1 /f
3. Allow the Remote desktop on your Windows firewall system with netsh command.
netsh advfirewall firewall set rule group="remote desktop" new enable=yes
4. Now, you need to add a user account to remote desktop users group. To do this using the “net localgroup” command.
net localgroup "remote desktop users" Shais /add
The username “Shais” has been added successfully to “Remote Desktop Users” group. You can test the remote desktop user members with below command.
net user Shais
That’s all you need to enable remote desktop using command line on any Windows operating systems.
If you want to do all with a graphical interface, follow the below Microsoft step by step guide to enable remote desktop.
Enable Remote Desktop Connection with GUI
To allow remote connections on the computer, you want to connect to:
- Open System by clicking the Start button, right-clicking Computer, and then click Properties.
- Click Remote settings.If you’re prompted for an administrator password or confirmation, type the password or provide confirmation. Under Remote Desktop, select one of the three options.
- Click Select Users.If you’re an administrator on the computer, your current user account will automatically be added to the list of remote users, and you can skip the next two steps.
- In the Remote Desktop Users dialog box, click Add.
- In the Select Users or Groups dialog box, do the following:
- To specify the search location, click Locations, and then select the location you want to search.
- In entering the object names to select, type the name of the user that you want to add, and then click OK.
- The name will be displayed in the list of users in the Remote Desktop Users dialog box. Click OK, and then click OK again.
To look up the computer name of the remote computer:
- On the remote computer, open System by clicking the Start button, right-clicking Computer, and then click Properties.
- Under Computer name, domain, and workgroup settings, you can find your computer name, and it’s full computer name if your computer is on a domain.
To allow Remote Desktop connections through a Windows Firewall:
If you’re having trouble connecting, Remote Desktop connections might be getting blocked by the firewall. Here’s how to change that setting on a Windows PC. If you’re using another firewall, make sure the port for Remote Desktop (usually 3389) is open.
- On the remote computer, click Start and select Control Panel.
- Click System and Security.
- Then click Allow a program through Windows Firewall under Windows Firewall.
- And click Change settings and then check the box next to Remote Desktop.
- Click OK to save the changes.
To set a password for your user account
Your user account must have a password before you can use Remote Desktop to connect to another computer.
- Click Start and select Control Panel.
- Double-click User Accounts.
- Select Change your Windows Password under User Accounts.
- Click Create a password for your account and follow the instructions on the screen.
To start Remote Desktop on the computer, you want to work from:
- Open Remote Desktop Connection by clicking the Start button. In the search box, type Remote Desktop Connection, and then, in the list of results, click Remote Desktop Connection.
- In the Computer box, type the name of the computer that you want to connect to, and then click Connect. (You can also type the IP address instead of the computer name.)
Finally, hope you can enable remote desktop using command line in your network environment.