'========================================================================== 'EnableRemoteDesktop.vbs 'Created by Timothy Bourne. 'http://www.imric.co.uk 'Last Modified: 26/07/06 '========================================================================== 'This VBscript will remotely enable remote desktop on the specified 'computer. '========================================================================== Option Explicit Dim strComputer Dim objWMIService, objItem Dim intValue Dim colItems 'Input box to enter target hostname. strComputer = inputbox("Please enter the computer to enable Remote " & _ "Desktop", "Remote Desktop Enable") intValue = 1 '(Enabled = 1, Disabled = 0) 'Connect to specified hostname and enable remote desktop (Terminal Services) set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") set colItems = objWMIService.ExecQuery("select * from Win32_TerminalServiceSetting") for each objItem in colItems objItem.SetAllowTSConnections(intValue) next WScript.Echo "Remote Desktop Enabled."