Get FailoverCluster Role Server Name from powershell

Kanak Agrawal 6 Reputation points
2022-09-30T10:29:01.74+00:00

Hi,

Kindly help here :

I am trying to programmatically get Server Name of all roles in the Failover Cluster. In the attached screenshot, Server Name is sql-fci-clus-2. What powershell command can I run to get it programmatically?

I tried using the Get-ClusterResource but there are no option to filter by resource type.

Windows Server Clustering
Windows Server Clustering
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Clustering: The grouping of multiple servers in a way that allows them to appear to be a single unit to client computers on a network. Clustering is a means of increasing network capacity, providing live backup in case one of the servers fails, and improving data security.
1,016 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 44,431 Reputation points
    2022-09-30T15:37:31.377+00:00

    Hi KanakAgrawal-6035,

    You may find the Get-ClusterGroup command more useful, although you may need to identify each role individually in order to get the devices with those roles. please see:

    https://learn.microsoft.com/powershell/module/failoverclusters/get-clustergroup?view=windowsserver2022-ps

    I hope this answers your question.

    --------------------------------------------------------------------------------------------------------------------------------------------------

    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.