====== Enable RDP from powershell on windows 8/11 ======
To enable remote desktop connections under Windows 8, just start powershell and enter these commands:
(Get-WmiObject win32_TerminalServiceSetting -Namespace root\\cimv2\\TerminalServices).SetAllowTSConnections(1)
import-module netsecurity -ea stop ; Get-NetFirewallRule | ? {$_.displayname -like \"remote desktop*\"} | Set-NetFirewallRule -enabled true
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -name "fDenyTSConnections" -value 0
Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
The commands can be ran remotely if you have [[http://www.bitvise.com/winsshd|SSH]] server installed - like i did :)