[Script of Sep. 16] T-SQL script to capture topology of an AlwaysOn configuration in SQL Server

Script Download: AlwaysOnDataCollection.zip
https://gallery.technet.microsoft.com/T-SQL-script-to-capture-add13e98

This T-SQL sample script quickly captures topology of an AlwaysOn configuration in SQL Server.

Knowing a topology is a frequent ask in TechNet forums and in CSS for troubleshooting.  IT professionals want to understand the topology so as to quickly understand help in troubleshooting. There are multiple dynamic views (DMVs) to get this data so getting this data manually is possible but can take longer. This script has been tested in SQL Server 2012.

This script queries Dynamic Management Views DMVs and draws out the AlwaysOn topology. It helps us understand the topology and displays various other details that we need to understand the issue and thus helps us to troubleshoot the issue faster.

image image
image

You can find more All-In-One Script Framework script samples at https://aka.ms/onescriptingallery