SetAllowTSConnections

T

Ty Moffett

I am trying to write a very simple VBScript to enable Remote Desktop on a
given Windows XP machine.

I've found the SetAllowTSConnections method in the
Win32_TerminalServiceSetting namespace but I don't understand how to use it.

I have a regisry hack that does the same thing but I thought I'd try to do
it the right way instead.


Can anyone help me out?
 
T

Ty Moffett

For those that might be interested here is the code.

strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "\\" & strComputer &
"\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from
Win32_TerminalServiceSetting")
For Each objItem In colItems
objItem.SetAllowTSConnections(1)
Next
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top