PowerShell: List All IPs Used by Cluster

Snippet:

# Obtain IPs of resources in cluster
function getResourceIPs {
$resourceIPs=Get-Cluster | Get-ClusterResource | ?{$_.ResourceType -like "IP Address"}
foreach ($resource in $resourceIPs) {
$resource | select OwnerGroup,
@{Name="Address"; Expression={$_ | Get-ClusterParameter -Name Address | select -ExpandProperty Value}},
@{Name="SubnetMask"; Expression={$_ | Get-ClusterParameter -Name SubnetMask | select -ExpandProperty Value}}
}
}

Sample output:

OwnerGroup      Address       SubnetMask
---------- ------- ----------
Cluster Group 192.168.500.112 255.255.255.0
COCOSHOME40-41-n 192.168.500.10 255.255.255.0
COCOECAPPS01-n 192.168.500.11 255.255.255.0
COCOECDIST01-n 192.168.500.12 255.255.255.0
COCOECELRNFS01-n 192.168.500.13 255.255.255.0
COCOECIMAGES01-n 192.168.500.14 255.255.255.0
COCOECLMSFS01-n 192.168.500.16 255.255.255.0
COCOECSHARE01-n 192.168.500.17 255.255.255.0
COCOECZANGLEBK-n 192.168.500.18 255.255.255.0
COCOFSHOME01-n 192.168.500.19 255.255.255.0
COCOFSSHARE01-n 192.168.500.20 255.255.255.0
COCOSHOME01-n 192.168.500.3 255.255.255.0
COCOSHOME30-31-n 192.168.500.5 255.255.255.0
COCOSHOME32-33-n 192.168.500.6 255.255.255.0
COCOSHOME34-35-n 192.168.500.7 255.255.255.0
COCOSHOME36-37-n 192.168.500.8 255.255.255.0
COCOSHOME38-39-n 192.168.500.9 255.255.255.0

Leave a Reply

Your email address will not be published. Required fields are marked *