December 3, 2010 at 2:56 pm
Hi, I want to create same password for 150 users in a database with script no GUI, I am told i can do that using cursor but i dont have any experience creating and specially using cursors.
Anybody has a script to help me to create password for already created users.
Thanks
Irfan
December 3, 2010 at 3:11 pm
Running the query below with results to text will generate the script to change all SQL login passwords.
SELECT 'ALTER LOGIN '+'['+name+']'+' WITH PASSWORD = ''<yourpasswordhere>'';'
FROM sys.server_principals
WHERE type = 'S'
December 3, 2010 at 3:19 pm
Thanks for quick reply, but i dont want to change password for all users, only for select users, i have around 200 user but want to change only of around 150.
Thanks again for response.
Irfan
December 3, 2010 at 4:23 pm
Delete the 50 in the script you don't need. Or figure out how you determine which 150 you need. There isn't a script that can read your mind to determine which ones need to be changed.
December 3, 2010 at 4:27 pm
ok, I'll ask - why do you want all your users (well, three quarters) to have the same password?
---------------------------------------------------------------------
December 3, 2010 at 10:38 pm
george sibbald (12/3/2010)
ok, I'll ask - why do you want all your users (well, three quarters) to have the same password?
I'm right there with George on this one. There's no absolutely no accountability if so many users are assigned the same password unless it's a one time password that they're required to change on the first login.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply