#Add SnapIn for iControl
$BIGIP = "serverUrl"
$User = "username"
$Pass = "password"
Initialize-F5.iControl -HostName $BIGIP -Username $User -Password $Pass
$ic = Get-F5.iControl
#Get list of all GTM Virtual Servers
$GTMlist = $ic.GlobalLBVirtualServerV2.get_list()
#Loop through virtual servers
foreach ($server in $GTMlist)
#Get the associated LTM virtual server
$LTMVirtualServer = $ic.GlobalLBVirtualServerV2.get_ltm_virtual_server($server)
#Output to screen
The BIG-IP API Reference documentation contains community-contributed content. F5 does not monitor
or control community code contributions. We make no guarantees or warranties regarding the available code,
and it may contain errors, defects, bugs, inaccuracies, or security vulnerabilities. Your access to and use of any
code available in the BIG-IP API reference guides is solely at your own risk.