Which cluster role belong to which availability group in SQL Server
The below PowerShell query will tell you about the which cluster role belongs to which SQL Server availability group. If you have multiple SQL server named instances and you have multiple availability groups.
#if the all the roles starting with same name text
Get-ClusterResource -Name *ServerName*|
Where-Object {($_.ResourceType -notin ('IP Address','Network Name'))}
#if the all the roles are different names with one other you
need to pass the individual name
Get-ClusterResource -Name ServerName|
Where-Object {($_.ResourceType -notin ('IP Address','Network Name'))}
Comments