Forum Discussion
Ken_B_50116
Cirrostratus
Jun 23, 2016How to use Get-F5.iControl to get the destination IP of virtual server?
I'm trying to use Get-F5.iControl in Powershell to fetch the destination IP address of a virtual server. I have the iControl Powershell module installed and I can query LTM successfully, for example:...
Jul 06, 2016
Here's how you can get the destination addresses of all virtuals
$VSList = (Get-F5.iControl).LocalLBVirtualServer.get_list();
$AddressPortList = (Get-F5.iControl).LocalLBVirtualServer.get_destination_v2($VSList);
for($i=0; $i -lt $AddressPortList.length; $i++) {
$virtual = $VSList[$i];
$vaddr = $AddressPortList[$i].address;
$vport = $AddressPortList[$i].port;
Write-Host "Virtual ${virtual} -> ${vaddr}:${vport}"
}
This was written without testing to I apologize in advance for any typos...
For future reference, I've put together a lot of PowerShell articles and samples that are listed in the iControl Wiki at https://devcentral.f5.com/wiki/iControl.PowerShell.ashx
Hope this helps!
-Joe
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects