Blog

Enable RDP Access

Quick script to enable RDP sessions on a computer

Taken from

1
2
3
4
5
6
7
8
9
10
Const ENABLE_CONNECTIONS = 1
 
strComputer = "."
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

Posted in: Scripts, Technical

Leave a Comment (1) ↓

1 Comment

  1. Douglas Mortensen February 19, 2013

    I have done this in the past via remote registry. In those cases, it required a reboot of the PC. Do you know whether your method above requires the PC to be rebooted before taking effect?

    Thanks,

    Doug

    reply

Leave a Comment