Execution Flow
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
| Parameter | Type | Default | Description |
|---|---|---|---|
| -ComputerName | String | local | Target cluster node to query (remote Get-Cluster connection). |
| -NoAutoInstall | Switch | false | Suppress automatic RSAT installation. Throws if the FailoverClusters module is missing. |
| -IncludeClusterGroup | Switch | false | Include the "Cluster Group" (cluster core resources) in the Roles list. |
| -EnableException | Switch | false | Throw terminating exceptions instead of writing errors. |
Return Value
Single [PSCustomObject]:
| Property | Description |
|---|---|
| Success | Boolean — false if cluster not found or module install failed. |
| ErrorMessage | Error text when Success = false. |
| ClusterName | Cluster name from Get-Cluster. |
| Nodes | Array of PSCustomObject: NodeName, State (Up/Down/Paused), NodeWeight. |
| Roles | Array 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