Enable Remote Desktop via Powershell Remotely

September 4, 2014

 

Many times throughout my projects, I find it necessary to enable remote desktop on machines that I do not have console access to – usually because I myself am working remotely on the customer.

While there has always been the method of editing the registry remotely to enable Remote Desktop, this method requires the server to be rebooted. So, what’s the method to avoid server downtime?

The answer is powershell.

(GetWmiObject Win32_TerminalServiceSetting -Computername ServerNameHere Namespace root\cimv2\TerminalServices).SetAllowTsConnections(1,1) | OutNull


(
GetWmiObject Class “Win32_TSGeneralSetting” -Computername ServerNameHere Namespace root\cimv2\TerminalServices Filter “TerminalName=’RDP-tcp'”).SetUserAuthenticationRequired(0) | Out
Null

This will immediately enable Remote Desktop on the specified server.

Tags: , , , ,

2 Responses to “Enable Remote Desktop via Powershell Remotely”


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.


2013 | 2014 | 2015 | 2016 | 2017

Sponsors

Categories