Logins aren't syncing across Availability Groups

My understanding is that if you aren't using Contained Databases, you will have to ensure logins are created on other instances manually.

Something like this script from SQLSoldier, originally posted as Transferring Logins to a Database Mirror, should do the trick.


You must either use a Contained Database, or you must recreate the users on the other server(s) with the same password hash and SID.

A script to do this is provided by Microsoft: How to transfer logins and passwords between instances of SQL Server

Mark's solution was partially right however his recommended solution was for Mirrored databases, as opposed to AlwaysOn which is what the questions asks for.