VBS Script – Remotely Enable Remote Desktop

The following script can be used to remotely enable the remote desktop service on Windows XP

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
Wscript.Echo UCase(strComputer) & " Remote Desktop Is Now Enabled"

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *