This page applies to SQL Server 2012 specifically but should generally apply to all versions up to and including SQL Server 2016.Â
For SQL Server 2017 and above the steps may be different since the servers no longer need to be part of a Windows Failover Cluster before starting the Availability Group configuration.Enable AlwaysOn Availability Groups on all SQL Server instances to be added to the AlwaysOn Availability Group...
Repeat these steps on all SQL Servers
Restart-Service -Name MSSQLSERVER -Force
Create a new AD Group containing the Service Accounts for all database instances to be added to the AlwaysOn Availability Group...
Add the Service Account for each database instance to the new group...
Create a Login for the AD Group (created above) in all database instances to be added to the AlwaysOn Availability Group...
Note that granting sysadmin to this group may not be the most secure way of giving us what we need here. TODO: Update this page with better recommendations.Setup the Availability Group...
 Assumes the Database exists on the Primary but not yet on any Replicas