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

Popular posts from this blog

Always On FailOver Events

System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out

Pre login Handshake or Connection Timeout Period