With Rules object you can access to count of rules, indexes of each rule and it's other properties. Also you can obtain Rule objects from this object.




'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, "MyNewRule"


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



       'Find new added rule

       Set Rule = .FindByName("MyNewRule")


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


End With


Set TrafficFilter = Nothing


Set Remote = Nothing


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