Skip to content

Instantly share code, notes, and snippets.

@Szeraax
Created April 24, 2018 16:29
Show Gist options
  • Save Szeraax/f382592192e45ab722b668943c5a8300 to your computer and use it in GitHub Desktop.
Save Szeraax/f382592192e45ab722b668943c5a8300 to your computer and use it in GitHub Desktop.
function Enable-RDPAccess ($TargetComputer)
{
Invoke-Command -ComputerName $TargetComputer {
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
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment