Created
March 10, 2016 20:57
-
-
Save srpomeroy/a505950e613a5429b654 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#PowerShell | |
#This script will allow you to remotely enable RDP via PowerShell Remoting | |
$Server = Read-Host -Prompt "Name of server:" | |
Invoke-Command -ComputerName $Server -Credential (Get-Credential) -ScriptBlock { | |
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server' -Name fDenyTSConnections -Value 0 | |
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -Name UserAuthentication -Value 1 | |
Set-NetFirewallRule -DisplayGroup 'Remote Desktop' -Enabled True } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment