On Error Resume Next
'## Assign CDN IPSec Policy ##
Const WINDOWS = &H24&
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(WINDOWS)
Set objFolderItem = objFolder.Self
windir = objFolderItem.Path
count = 0
ncount = 1
hostsdir = windir & "\system32\netsh.exe /c "
'wscript.echo hostsdir
cmdline00 = "netsh advfirewall set allprofiles state off"
cmdline01 = "netsh ipsec static add policy Testing assign=yes"
cmdline02 = "netsh ipsec static add filteraction name=perm action=permit"
cmdline03 = "netsh ipsec static add filteraction name=blk action=block"
'Allow3389
cmdline04 = "netsh ipsec static add filter filterlist=Allow3389 srcaddr=x.x.x.0 srcmask=255.255.255.0 dstaddr=me protocol=tcp srcport=0 dstport=3389"
cmdline05 = "netsh ipsec static add rule name=Allow3389 policy=CDN filterlist=Allow3389 filteraction=perm"
set wshell = CreateObject("WScript.Shell")
rtn = wshell.Run (cmdline00, 5, True)
rtn = wshell.Run (cmdline01, 5, True)
rtn = wshell.Run (cmdline02, 5, True)
rtn = wshell.Run (cmdline03, 5, True)
rtn = wshell.Run (cmdline04, 5, True)
rtn = wshell.Run (cmdline05, 5, True)
'if rtn= 0 then
' strMsg1 = "IPSec Settings: Success."
' msgbox strMsg1
' else strMsg0 = "IPSec Settings: Failed."
' msgboxstrMsg0
'end if
set wshell = nothing