Created
February 12, 2013 03:33
-
-
Save hackingbutlegal/4760041 to your computer and use it in GitHub Desktop.
Windows: Remotely unlock RDP.
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
strComputer = InputBox ("Enter Machine Name") | |
Set objWMIService = GetObject("winmgmts:" _ | |
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") | |
Set colTSSettings = objWMIService.InstancesOf("Win32_TerminalServiceSetting") | |
For Each colTS in colTSSettings | |
colTS.SetAllowTSConnections(1) | |
Wscript.Echo UCase(strComputer) & "Remote Desktop Is Now Enabled" | |
Next |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment