Forum Discussion

Dustin_132959's avatar
Dustin_132959
Icon for Nimbostratus rankNimbostratus
Jul 10, 2015

LTM 11.4.1 iControl Snapin Firewall Rules

I have been following the iControl documentation for pulling firewall rule information out of our LTM using PowerShell and the iControl Snapin. It works for most of the properties I am trying to query, but I get the below error when I attempt to query get_fw_rule_source_address, get_fw_rule_source_vlan, get_fw_rule_source_port, get_fw_rule_destination_address, & get_fw_rule_destination_port.

 

Exception calling "get_fw_rule_destination_port" with "2" argument(s): "There is an error in XML document (11, 2).

 

I use the same variables in the query as the get_fw_rule_state (which works fine). Here is an example of the code:

 

$virtualservers = (Get-F5.LTMVirtualServer).name foreach ($virtualserver in $virtualservers) { $firewallrules = ($ic.LocalLBVirtualServer.get_fw_rule($virtualserver))[0] foreach ($firewallrule in $firewallrules) { $sourceport = $ic.LocalLBVirtualServer.get_fw_rule_source_port($virtualserver,$firewallrule) } }

 

Am I doing something wrong? It appears that the arguments I am providing meets the documentation. Any help is appreciated.

 

Thank you.

 

1 Reply

  • For some reason, the code didn't format correctly and I can't edit it. Here is an example of the code:

     

    $virtualservers = (Get-F5.LTMVirtualServer).name
    foreach ($virtualserver in $virtualservers)
    {
        $firewallrules = ($ic.LocalLBVirtualServer.get_fw_rule($virtualserver))[0]
            foreach ($firewallrule in $firewallrules)
            {
            $sourceport = $ic.LocalLBVirtualServer.get_fw_rule_source_port($virtualserver,$firewallrule)
        }
    }