With Rule object you can access to count of Actions (Events) in Rule, Rule properties, methods.




'netcom.dll contains 'NetCom.Remote' object.

Set Remote = CreateObject("NetCom.Remote")


With Remote

       .Host = ""

       .Port = 42566

       .UserName = "Administrator"

       .Password = "mypass"

       'Connect and query remote TrafficFilter object

       Set TrafficFilter = .CreateRoot

End With


Set Rules = TrafficFilter.Rules

With Rules

       'Add new rule as first in list

       .Insert 0, "NATRule"


       'Find new added rule

       Set Rule = .FindByName("NATRule")

       With Rule

               .Enabled = False

               'Allow packets

               .Action = 1


               'NAT source IP automatically

               .ActionsRoute.ChangeSourceIP = True

               .ActionRouteSourceIPAuto = True


               'NAT source port automatically

               .ActionsRoute.ChangeSourcePort = True

               .ActionRouteSourcePortAuto = True


               'Enable addition packet information to the NAT table

               .ActionRouteNAT = True


               'Specify conditions

               .ConditionPacketsDirection = 1 'Outgoing to network packets

               .ConditionIPSource.AsString = ""

               .ConditionIPOperatorSource = 1 'Equal to ConditionIPSource

               .ConditionIPRangeDest.AddAsStringRange "", ""

               .ConditionIPOperatorDest = 4 'NOT in ConditionIPRangeDest range


               .Enabled = True

       End With


       'Force configuration saving (normally configuration saved every 3 minutes automatically)



       WScript.Echo "Added new rule with name " & Rule.Name

End With


Set Rule = Nothing

Set Rules = Nothing

Set TrafficFilter = Nothing


Set Remote = Nothing


WScript.Echo vbCrLf & "Press any key..."