Quick script to enable RDP sessions on a computer
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
1 Comment
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