Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Script for Copying Logins from one server to other server with database Expand / Collapse
Author
Message
Posted Thursday, April 23, 2009 2:36 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, April 30, 2009 8:27 PM
Points: 7, Visits: 16
Hi,

I want to copy a set of windows Logins & Database Logins from one server to other sever with same roles setup & Passwords.

Please guide me how to do this.

Cheers,
Anil
Post #702963
Posted Thursday, April 23, 2009 7:31 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Friday, July 11, 2014 10:29 PM
Points: 2,007, Visits: 6,077
Take a look at http://support.microsoft.com/kb/918992. This works in 2008 as well as 2005.



Shamless self promotion - read my blog http://sirsql.net
Post #703161
Posted Thursday, April 23, 2009 9:13 AM
SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: 2 days ago @ 10:17 AM
Points: 4,065, Visits: 5,315
I've used this script, which is a modified version of sp_help_revlogin, to script out logins, server roles, database users, database roles, and object permissions. Remember that the databases need to exist in the destination server before you can create users. Considering that, you might as well backup and restore the databases, which would also move the database users and their permissions.

http://www.sqlservercentral.com/scripts/31776/


Greg
Post #703314
Posted Thursday, April 23, 2009 5:50 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, April 30, 2009 8:27 PM
Points: 7, Visits: 16
Hi All,

Thanks for the reply. If we Back up & restore the database in another server whether all security Objects like Users,
Roles etc will also move to new server.

Suppose if some of the users alreday exists on new server is there any way to skip that users.

Please let me know on this.

Cheers,
Anil
Post #703684
Posted Thursday, April 23, 2009 9:32 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, April 30, 2009 8:27 PM
Points: 7, Visits: 16
Hi All,

Sorry, One more question if the User IDs already exists in the server I need replace the User IDs during Copy of logins.

Please let me know is this possible?

Cheers,
Anil
Post #703724
Posted Friday, April 24, 2009 9:34 AM
SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: 2 days ago @ 10:17 AM
Points: 4,065, Visits: 5,315
Anil Kumar Kurra (4/23/2009)
Hi All,

Thanks for the reply. If we Back up & restore the database in another server whether all security Objects like Users,
Roles etc will also move to new server.

Suppose if some of the users alreday exists on new server is there any way to skip that users.

Please let me know on this.


The difference between a login and an user - a login allows a person to connect to SQL Server; a user allows a person to access objects in a database.

So users only exist in databases. If you restore a database users, roles, and schemas are also restored. After copying logins and databases to a new server, you may need to re-sync the users with their logins. See sp_change_users_login in BooksOnLine.


Greg
Post #704077
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse