SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


domain conversion and logins and users


domain conversion and logins and users

Author
Message
timscronin
timscronin
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1600 Visits: 750
I have a sql 2005 server that supports a 3rd party app. Users connect with win/sql authentication, the 3rd party app then has an interface to add the users to the database. In sql logins you see
mydomain\myname. In the users in the database you only see myname. We are converting domains, which means I need to script out all logins and users. The trick is now the login will be
newdomainame\myname. The usernames in the database could stay the same but would be mapped to the old logins. At the login level I know how to script them all out and then do a quick replace with the new domain name. The trick is the users and either scripting them out out making sure when the logins go back in that they are mapped to the correct users. Any ideas on how to handle this?
Thanks



Orlando Colamatteo
Orlando Colamatteo
SSC-Forever
SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)

Group: General Forum Members
Points: 40458 Visits: 14413
No need to script them out. You can generate a command like this for each user with the new login for each. Just make sure you supply the NAME option and reiterate the name you want for the user otherwise SQL Server will rename the user to the new login name:

ALTER USER [User.Name] WITH LOGIN = [NEWDOMAIN\User.Name], NAME = [User.Name];



__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search