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. Warning This script is not to be run in a production environment. The purpose of this script is to see if the SQL AlwaysOn Availability …