Forum Discussion
Michael_Jenkins
Jan 25, 2015Cirrostratus
If you wanted to find out what pools are using a specific node (through name or ip address) with iControlREST and wanted to user PowerShell, you could use this script...
Get the credentials for the BIG-IP
$cred = Get-Credential;
iControlREST url for pools (expand sub references)
$url = "https://example.com/mgmt/tm/ltm/pool?expandSubcollections=true"
Get the pools
$pools = Invoke-RestMethod -Method GET -URI $url -Credential $cred;
Specify which node you're looking for (name or ip)
$node = "1.1.1.1";
Filter the pools based on containing the specified node (wildcard search on name and ip)
$poolsF = @($pools.items | ?{$_.membersReference.items | ?{ $_.name -like "*$($node)*" -or $_.address -like "*$($node)*" } };)
Get an array of the pool names containg the node
$poolNames = $poolsF | Select -ExpandProperty name;