Get-sqmClusterInfo Always On

Returns WSFC cluster topology: cluster name, all nodes, all roles (cluster groups), and the IP addresses assigned to each role. Auto-installs the FailoverClusters PowerShell module (RSAT) if missing. No ShouldProcess — read-only operation.

Execution Flow

START FailoverClusters module available? NO Auto-install Server: RSAT- Clustering-PS or Add-WindowsCapability Get-Cluster → validate cluster membership / -NoAutoInstall exit cluster found? return error NO Get-ClusterNode → $nodes (Name, State, NodeWeight) foreach ClusterGroup (excl. "Available Storage"; opt. excl. "Cluster Group") Get-ClusterGroup → Name, State, OwnerNode, GroupType Get-ClusterResource WHERE ResourceType="IP Address" Get-ClusterParameter Address → IPAddresses[] Build Role: Name/State/OwnerNode/IPAddresses[] Build result: Success/ClusterName/Nodes[]/Roles[] DONE

Synopsis

Queries the local or remote Windows Server Failover Cluster (WSFC) using the FailoverClusters PowerShell module. Returns all cluster nodes with their state and vote weight, plus all cluster roles with their owner node and virtual IP addresses. The FailoverClusters module is auto-installed via RSAT if missing (Server: Install-WindowsFeature RSAT-Clustering-PowerShell; Client: Add-WindowsCapability Rsat.Clustering). The auto-install can be suppressed with -NoAutoInstall.

No dbatools required. No ShouldProcess (read-only). Always Storage and Cluster Group roles are excluded from the Roles list by default to reduce noise.

Syntax

Get-sqmClusterInfo
    [-ComputerName <String>]
    [-NoAutoInstall]
    [-IncludeClusterGroup]
    [-EnableException]

Parameters

ParameterTypeDefaultDescription
-ComputerNameStringlocalTarget cluster node to query (remote Get-Cluster connection).
-NoAutoInstallSwitchfalseSuppress automatic RSAT installation. Throws if the FailoverClusters module is missing.
-IncludeClusterGroupSwitchfalseInclude the "Cluster Group" (cluster core resources) in the Roles list.
-EnableExceptionSwitchfalseThrow terminating exceptions instead of writing errors.

Return Value

Single [PSCustomObject]:

PropertyDescription
SuccessBoolean — false if cluster not found or module install failed.
ErrorMessageError text when Success = false.
ClusterNameCluster name from Get-Cluster.
NodesArray of PSCustomObject: NodeName, State (Up/Down/Paused), NodeWeight.
RolesArray of PSCustomObject: Name, State, OwnerNode, IPAddresses[].

Examples

# Query local cluster
Get-sqmClusterInfo

# Query a specific node, include Cluster Group role
Get-sqmClusterInfo -ComputerName "SQL01" -IncludeClusterGroup

# Show all IP addresses of all roles
(Get-sqmClusterInfo).Roles | Select-Object Name, IPAddresses

# Suppress RSAT auto-install (required on locked-down servers)
Get-sqmClusterInfo -NoAutoInstall -EnableException