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

SQL Orphan login issue Expand / Collapse
Author
Message
Posted Thursday, December 5, 2013 7:30 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Sunday, August 17, 2014 6:52 AM
Points: 24, Visits: 233
I copied database from Prod to Dev instance. Whe the database was restored I ran
-----See if there are any orphan users:
EXEC sp_change_users_login 'Report'
The output was :

finq_sql 0xB058747F1E577148862C570381789901
linkserver 0xE040BAD5EEE23049B759C8D750F6C82E

NOTE : These 2 users are SQL users only and I not have password for them. They are there in Prod but not in Dev. SO How do i crate those users in Dev from Prod. I did script the user from Prod but gives me error that 'it does not meet the minimum password requirement'

Can someone please tell me how to create user at instance level and map it to database in Dev?
Post #1520069
Posted Thursday, December 5, 2013 7:36 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Today @ 10:39 AM
Points: 588, Visits: 893
In your script that you have to create the logins in dev you need to add the following:
, CHECK_POLICY = OFF

to turn off the password policy. After that try running your sproc again.




Microsoft Certified Master - SQL Server 2008
Follow me on twitter: @keith_tate

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1520079
Posted Thursday, December 5, 2013 7:58 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Sunday, May 25, 2014 10:09 AM
Points: 283, Visits: 1,114
http://www.sqlservercentral.com/scripts/Logins/104750/

If you are comfortable with PowerShell, this will script the login with the same password and SID.



Check Your SQL Servers Quickly and Easily
www.sqlcopilot.com
Post #1520100
Posted Thursday, December 5, 2013 8:16 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Thursday, July 31, 2014 10:37 PM
Points: 984, Visits: 1,325
I use the Auto_Fix option on sp_change_users_login to fix orphan users.

Kurt


Kurt W. Zimmerman
SR DBA
Lefrak Organization
New York, NY

http://www.linkedin.com/in/kurtwzimmerman
Post #1520114
Posted Thursday, December 5, 2013 8:31 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 10:15 AM
Points: 6,279, Visits: 13,520
Aatish Patel (12/5/2013)
I copied database from Prod to Dev instance. Whe the database was restored I ran
-----See if there are any orphan users:
EXEC sp_change_users_login 'Report'
The output was :

finq_sql 0xB058747F1E577148862C570381789901
linkserver 0xE040BAD5EEE23049B759C8D750F6C82E

NOTE : These 2 users are SQL users only and I not have password for them. They are there in Prod but not in Dev. SO How do i crate those users in Dev from Prod. I did script the user from Prod but gives me error that 'it does not meet the minimum password requirement'

Can someone please tell me how to create user at instance level and map it to database in Dev?

This script will generate the create login command retaining the password and SID. execute the script itself against the Prod server and then execute the output against the dev server

SELECT		'CREATE LOGIN ' + name + ' WITH PASSWORD = ' + 
sys.fn_varbintohexstr(password_hash) +
' HASHED, SID = ' + sys.fn_varbintohexstr(sid) +
', DEFAULT_DATABASE = ' + QUOTENAME(default_database_name) +
', DEFAULT_LANGUAGE = ' + default_language_name +
', CHECK_EXPIRATION = ' +
CASE
WHEN is_expiration_checked = 0 THEN 'OFF'
ELSE 'ON'
END +
', CHECK_POLICY = ' +
CASE
WHEN is_policy_checked = 0 THEN 'OFF'
ELSE 'ON'
END
FROM master.sys.sql_logins
WHERE name = 'yoursqllogin'



-----------------------------------------------------------------------------------------------------------

"Ya can't make an omelette without breaking just a few eggs"
Post #1520130
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse