Using PowerShell to Enable Remote Desktop

Posted by: Nathan Taylor
Category: Company News, Tech Advice

I had a computer that I needed to remote into. I didn’t have any of my normal remote access tools installed on it, so I needed to find another way into it remotely.

First I enabled PowerShell Remoting via Group Policy. This involved telling windows to start listening for PowerShell requests and defining which networks it would accept requests from. You also have to start a service and open some firewall ports. After you make these changes, you have to wait for group policy to update which can take a while. Here’s the article I followed:

Then I opened PowerShell ISE on one of the servers in the domain and ran this command to remote to the machine:

Enter-PSSession -ComputerName


Then I ran these commands:

1) Enable Remote Desktop

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


2) Allow incoming RDP on firewall

Enable-NetFirewallRule -DisplayGroup "Remote Desktop"


3) Enable secure RDP authentication

set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "UserAuthentication" -Value 1


From <>


I then tried Remote Desktop and it worked! PowerShell for the win!


If you want more information about PowerShell, I recommend 2 great resources:

Learn PowerShell in a month of lunches by Don Jones:

Microsoft Virtual Academy PowerShell 3.o jumpstart video:


Author: Nathan Taylor
Lead Engineer Nathan has been helping companies get the most value from their technology investments for over 10 years. He specializes in designing and maintaining Windows networks and working with various cloud technologies including Office 365 and Azure.