Sunday, February 26, 2012

Does anyone have a script to reset all logins on a server?

We want to merge 2 SQL servers into one. This means we will have duplicate logins with differing passwords.

We want to reset all the passwords on one server to something memorable. Does anyone have a script that cursor through (or trans - I'm not shy) all the logins in a mster db? I really don't fance going through hundreds of logins changing their passwords by hand!

Looking into it, I think I can cursor through master.dbo.sysxlogins and reset the passwords using sp_password, as such:

sp_password Null, 'Newpassword', 'loginname'

Anyone see a problem with the above?

No comments:

Post a Comment