通过Powershell开启RDP

1) Enable Remote Desktop

set-ItemProperty -Path 'HKLM:SystemCurrentControlSetControlTerminal 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:SystemCurrentControlSetControlTerminal ServerWinStationsRDP-Tcp' -name "UserAuthentication" -Value 1
原文地址:https://www.cnblogs.com/IvanChen/p/4487631.html