Enable RDP – PowerShell Registry Commands

- HelpWire
- →
- Blog
- →
- Definitive Guide to using Microsoft Remote Desktop
- →
- How to remotely enable RDP
- →
- How to enable RDP with PowerShell
If you are a Windows administrator, you may encounter the need to enable RDP via PowerShell. A PowerShell session is one of the few ways to enable Remote Desktop remotely on a Windows 11 computer. Even if you’re configuring it locally, a set of PowerShell commands is faster to run than manually digging around in the Registry Editor.
In addition to commands to enable RDP, this article also features commands to disable it, or to run a PowerShell check if RDP is enabled.
How to Enable RDP via PowerShell
-
Open PowerShell by pressing Win+X and selecting “Terminal (Admin)”.
-
If you’re trying to enable PowerShell remotely, use the Enter-PSSession command to connect to a remote computer.
-
Run the following commands:
Set-ItemProperty -Path `
‘HKLM:\System\CurrentControlSet\Control\Terminal Server’ `
-name “fDenyTSConnections” -value 0Set-ItemProperty -Path `
“HKLM:\SYSTEM\CurrentControlSet\Control\Terminal
Server\WinStations\RDP-Tcp” `
-Name “UserAuthentication” -Value 1
The latter command is for additional safety, since it prevents unauthorized RDP access to the remote computer. -
Run the command Enable-NetFirewallRule -DisplayGroup “Remote Desktop” to allow RDP sessions through the Windows Firewall.
The computer is now ready for RDP access.
Additional PowerShell RDP Hints
Once you have PowerShell enable RDP, disabling it is just as easy. The commands are reversed:
Set-ItemProperty -Path`
‘HKLM:\System\CurrentControlSet\Control\Terminal Server’ `
-name “fDenyTSConnections” -value 0
Disable-NetFirewallRule -DisplayGroup “Remote Desktop”

There are also multiple ways to check if it’s enabled. One way is to manually go to the “Local Machine\System\CurrentControlSet\Control\Terminal Server” key in the Registry Editor and look at the value:

Alternatively, you can do a PowerShell check if RDP is enabled:
Get-ItemProperty -Path `
‘HKLM:\System\CurrentControlSet\Control\Terminal Server’ `
-name “fDenyTSConnections”

This is a PowerShell tutorial, but you can also enable RDP with the help of the command line, which can be helpful under specific circumstances. Additionally, if you have a domain set up, consider using group policies to enable RDP.