Powershell Test AlwaysOn

by Apr 15, 2016Microsoft, PowerShell, SQL Server 2012

Reading Time: 3 minutes

Powershell Test AlwaysOn

This script checks which node is the primary in the SQL AlwaysOn cluster. A test database has been added to see if that database is writable. All actions are logged to a log file.

This script is not to be run in a production environment. The purpose of this script is to see if the SQL AlwaysOn Availability Group has done a failover. It also checks if a database within this AG is writable and if not how long it has been offline.
The part to check which node is the primary has been found on a blog, which I would have given the credits if I remembered where I found it.

 

Harold Preyers

Harold Preyers

Solution Architect

VMware Certified Advanced Professional - Network Virtualization Design 2021

Archives

Categories