I need to duplicate all Logins and their associated database-level permissions from one server to another. I am using SQL Server 2008 R2 for Server A and SQL Server 2012 for Server B I am able to find a few different scripts to transfer Logins from server A to server B. However, I nee to also transfer database-level permissions for each Login.
I've reviewed the following for transferring Logins:
http://www.sqlsoldier.com/wp/sqlserver/transferring-logins-to-a-database-mirror http://support.microsoft.com/kb/918992
The SQL Soldier solution seems to work fine.
The same databases that reside on server A also reside on server B. how can I automate/script the Login and permissions transfer from one server to another?
how can I automate/script the Login and permissions transfer from one server to another?
You can usesqlcmd
and the top portion (only step 1) of the script from here or usingPowershell
- script from here