Skip to content

Instantly share code, notes, and snippets.

@rodmhgl
Created June 28, 2013 20:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rodmhgl/5887639 to your computer and use it in GitHub Desktop.
Save rodmhgl/5887639 to your computer and use it in GitHub Desktop.
Attempts to reset the RDP listener of a remote server. Sometimes it works, sometimes it doesn't, but it's always worth a shot.
function Reset-RDPListener {
param($ComputerName)
$ts = Get-WMIObject -class win32_Terminalservicesetting -comp $ComputerName
$ts.SetAllowTSConnections($false)
$ts.SetAllowTSConnections($true)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment