Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
prodigy2006
Yak Posting Veteran
66 Posts |
Posted - 2009-09-28 : 17:03:36
|
Could anyone please explain the process to unlock a SQL Server login account?Thanks,Sunny |
|
prodigy2006
Yak Posting Veteran
66 Posts |
Posted - 2009-09-29 : 10:44:29
|
Could anybody please reply to this post. |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2009-09-29 : 11:18:55
|
Did you look in Books Online under "ALTER LOGIN"? |
|
|
prodigy2006
Yak Posting Veteran
66 Posts |
Posted - 2009-09-29 : 12:40:58
|
I'm little confused here, is there a way to unlock a login without giving the password in the below Alter Login statement?Alter login <loginname> with password=<passwood> unlock.quote: Originally posted by robvolk Did you look in Books Online under "ALTER LOGIN"?
|
|
|
tripodal
Constraint Violating Yak Guru
259 Posts |
Posted - 2009-09-29 : 17:11:37
|
You are specifying the new password.Assuming you have correct permissions you will not have a problem. BOL quotequote: Requires ALTER ANY LOGIN permission.If the CREDENTIAL option is used, also requires ALTER ANY CREDENTIAL permission. If the login that is being altered is a grantee of CONTROL SERVER permission, also requires CONTROL SERVER permission when making the following changes: Resetting the password without supplying the old password. Enabling MUST_CHANGE, CHECK_POLICY, or CHECK_EXPIRATION. Changing the login name. Enabling or disabling the login. Mapping the login to a different credential.A principal can change the password, default language, and default database for its own login.
|
|
|
prodigy2006
Yak Posting Veteran
66 Posts |
Posted - 2009-09-29 : 18:37:36
|
I want to unlock the developer's login without changing the password.Will the below statement work:Alter login <loginname> unlock |
|
|
mcrowley
Aged Yak Warrior
771 Posts |
Posted - 2009-09-30 : 11:42:32
|
nope. You need the password. Tell the developer to be more careful about locking himself out. |
|
|
jeffw8713
Aged Yak Warrior
819 Posts |
Posted - 2009-09-30 : 18:16:14
|
If you really have to keep the password the same, then you can save the encrypted password value, unlock the account and change the password to a dummy string, then alter the login and change the password using the encrypted string.-- First step is to get our hashed password valueSELECT cast(loginproperty('LoginNameHere', 'PasswordHash') As varbinary(256));-- Save the above value somewhere, then unlock the accountALTER LOGIN LoginNameHere WITH PASSWORD = 'DummyPasswordHere' UNLOCK;-- Now, modify the login and reset the password with the old passwordALTER LOGIN LoginNameHere WITH PASSWORD = HashedPasswordHere HASHED; |
|
|
|
|
|
|
|