Unlock login without changing the password in SQL Server

When the "Enforce Password Policy" in the General page of SQL login properties is checked...

...depending on your security policy in Windows, the login will be locked out after defined number of unsuccessful login attempts:

There will be an error message when the login is locked out:

On the Status page of login properties "Login is locked out" field will be checked if the login is locked:

When you try to uncheck the "Login is locked out" field there may be an error when you click OK:

To unlock the login without resetting the login password, first uncheck the "Enforce Password Policy" in the General page of SQL login properties and click OK:

And then check the "Enforce Password Policy" in the General page of SQL login properties again, and the login will be unlocked without changing the password.

To unlock a login without changing the password using T-SQL:

ALTER LOGIN [John] WITH CHECK_POLICY = OFF;
ALTER LOGIN [John] WITH CHECK_POLICY = ON;
GO

If the post helped you, please share it:
Pin It

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">