enable RDP from Powershell

to enable RDP on 1 server its quite simple if you’re using the server GUI –

System Properties/Remote tab

SystemProperties_RDP

 

 

 

 

 

 

 

 

 

 

 

 

 

but on a complex environment you might consider the use of the GPO tool by creating a dedicated gpo for it.

  1. Navigate to Computer Configuration, Policies, Administrative Templates, Network, Network Connections, Windows Firewall, Domain Profile.
  2. Double-click Windows Firewall: Allow inbound Remote Desktop exception.

there’s also another way to enable RDP on remote or local Computer  / Servers via Powershell ,using the WMI

with this line you can get the details of the Terminal feature status –

Note ! in order to query servers on your network with WMI ,you must enable it via firewall/gpo.

if the status of the value “AllowTSConnections” is 0 ,then the RDP feature is disabled.

to change it you’ll need to run the following line –

to make it even more simple iv’e created a function that will check the status of the Terminal Server Settings on a Remote or local server ,it’ll show you the status and

it can also change it by typing “Enable”

Enable_RDP_via_PS

 

 

 

Enjoy !

 

(Visited 227 times, 1 visits today)

Leave a Reply