Script to enable Remote Desktop on a local /Remote system

Here is a script that is used to activate/enable remtote desktop(RDP) on a local /remote computers.

'*** Activates Remote Desktop on remote machine***
Const HKEY_LOCAL_MACHINE = &H80000002
'strComputer = "."
strComputer = Inputbox ("Enter Computername:","Activate Remote Desktop","Computername")

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")

strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server"

strValueName = "fDenyTSConnections"
dwValue = 0
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
msgbox "Remote Desktop is active!"

If you want to activate on a list of machines ,u can use FOR loop until it fisnihes to activate on all machines 🙂

Leave a Reply