script synchronize logins and permissions between principal and mirror servers

Hello,

I search a script to synchronize logins and permissions between principal and mirror servers.

Thanks

Regards
bibi92Asked:
Who is Participating?
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
This MSDN article has a script that do that.
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
The users are already in both databases, right? You just need to create the logins, correct?
You could create a script for the logins in the principal server and run it in the mirrored server and after that just run the following command for each user in the mirrored database:
EXEC sp_change_users_login 'Auto_Fix', 'UserName'
0
 
bibi92Author Commented:
Thanks but  I search to transfer login or synchronize them
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.