Forum Discussion
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
- Dustin_132959
Nimbostratus
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) } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com