want have it work on one machine - strComputer - "."
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
By the way if you want to turn off Remote Desktop just change the 1 in this line of codeConst ENABLE_CONNECTIONS = 1 to a 0 (Zero).
What do you think about this Article? Add your Opinion..! EmoticonEmoticon