|
Const ENABLE_CONNECTIONS = 1
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_TerminalServiceSetting")
For Each objItem in colItems
errResult = objItem.SetAllowTSConnections(ENABLE_CONNECTIONS)
Next
set oShell = WScript.CreateObject("WScript.shell")
oShell.run "cmd.exe /c netsh firewall add portopening tcp 3389 RemoteDestop",0,true
set oShell=nothing |
|