Posted On September 4, 2019

PowerShell: List All IPs Used by Cluster

kimconnect 2 comments
blog.KimConnect.com >> Codes >> 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

2 thoughts on “PowerShell: List All IPs Used by Cluster”

Leave a Reply

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

Related Post

PowerShell: Script to Stop, Start, Disable, and Enable Exchange Server

<#This script contains a set of functions to administer Exchange 2010, 2013, 2016, and 3000.…

PowerShell: Find Duplicate RDP Sessions on All Remote Desktop Servers Discovered Within the Domain

There's this module called 'PSTerminalServices' that has a method to collect active sessions on all…

How To Modify a Windows Service

Here's the freebie code: # Version 0.02 $serviceName='Windows_Exporter' $newExePath=$false $newSwitches=" --log.format logger:eventlog?name=$serviceName --collectors.enabled os,cpu,cs,logical_disk,net,tcp,service,textfile" function…