February 11, 2019 at 1:56 am
Hi, colleges.
How can I create a script that contains information for creation all SQL-logins including database users with all permissions?
It'll need after I'll move SQL server to another AD domain.
Previuous AD accounts will be destroyed.
Thanks in advance)
February 11, 2019 at 2:01 am
You can use sp_help_revlogin. Take a look at the following link for details:
https://support.microsoft.com/en-gb/help/918992/how-to-transfer-logins-and-passwords-between-instances-of-sql-server
Thanks
February 11, 2019 at 2:04 am
I forgot to add that you can also right click on your database in SSMS --> Tasks --> Generate Scripts and script out all your logins.
Thanks
February 11, 2019 at 2:17 am
NorthernSoul - Monday, February 11, 2019 2:01 AMYou can use sp_help_revlogin. Take a look at the following link for details:
https://support.microsoft.com/en-gb/help/918992/how-to-transfer-logins-and-passwords-between-instances-of-sql-serverThanks
this script generates logins only without database permissions
February 18, 2019 at 12:25 am
You can refer this post.
https://www.sqlservercentral.com/Forums/Topic1560182-1550-1.aspx
February 21, 2019 at 9:55 am
I personally like using the dbatools PowerShell module - https://dbatools.io/. There are several commands, like Export-DBALogin, that can assist with scripting out logins or users and their permissions.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply