Skip to content

Instantly share code, notes, and snippets.

@srpomeroy
Created March 10, 2016 20:57
Show Gist options
  • Save srpomeroy/a505950e613a5429b654 to your computer and use it in GitHub Desktop.
Save srpomeroy/a505950e613a5429b654 to your computer and use it in GitHub Desktop.
#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