Enable Remote Desktop On A Remote Computer

By | May 5, 2006

So, you need to remote into a computer but don’t have RDP enabled. This script will keep you from getting up from your desk by enabling Remote Desktop.

Copy and paste the following text into notepad and save it as a .vbs file.

———-COPY EVERYTHING BELOW THIS LINE———-

 

‘ Turn on Remote Desktop for any win XP or 2003 Computer
‘ Created by Cheyenne Harden  11.16.05

Const ENABLE_CONNECTIONS = 1
strComputer = inputbox(“Enter Target computer’s IP or name.”,title)
IF strComputer > “” Then
Set objWMIService = GetObject(“winmgmts:” _
& “{impersonationLevel=impersonate}\\” & strComputer & “\root\cimv2”)

Set colItems = objWMIService.ExecQuery _
(“Select * from Win32_TerminalServiceSetting”)

For Each objItem in colItems
errResult = objItem.SetAllowTSConnections(ENABLE_CONNECTIONS)
Next

Else
Wscript.Quit
End If

 

———-COPY EVERYTHING ABOVE THIS LINE———-

Here is what you need to know to run this script:
1. Name of the computer you are targeting

This information is provided “AS IS” with no warranty expressed or implied.

Leave a Reply

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