Created
June 28, 2013 20:02
-
-
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.
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
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