Powershell Missing Cluster Name for FCI

Posted on

Question :

I’m running the following simple Powershell command.

$Server = New-Object ('Microsoft.SqlServer.Management.Smo.Server') 'SerName'
$Server | SELECT *

For FCI clusters the ClusterName value is always blank and the ClusterQuorumState and ClusterQuorumType are always NotApplicable. IsClustered is set to True though.

If I run it against an Availability Group I get back the cluster name and the correct values for the other two properties.

Is there a way in Powershell to get the cluster name for the FCI instances? Another cmdlet I can use?

Answer :

No need to load up the Smo object, you can query WMI to get this

gwmi -Query "select Name from cim_cluster" -namespace rootmscluster -computername [computername] | select Name

Leave a Reply

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