Insights

Unlock Your Sitecore User Account Using SQL Server

How To Unlock Your Sitecore User Account Using SQL Server

Sometimes, our Sitecore account may become locked out due to incorrect password attempts, making it impossible to log in, even if we remember the correct password. As per Sitecore, our accounts get locked out after 5 invalid attempts. This can happen with the Sitecore admin or any user account. As you can see in the image below, my account is locked out (IsLockedOut=1) and I am unable to log into Sitecore.

Unlock Sitecore User Account Using SQL Server

Unlock Sitecore User Account Using SQL Server

However, we can easily unlock Sitecore admin or any user account using a straightforward SQL query.

Steps To Unlock Sitecore Admin Account Or Any User Account

Step 1

Log into the SQL server instance using SQL Server Management Studio(SSMS) and select the Sitecore instance’s core database to run the query.

Unlock Sitecore User Account Using SQL Server

Step 2

Copy and run the below SQL query.


UPDATE  aspnet_Membership 
SET     IsLockedOut = 0, 
        FailedPasswordAttemptCount = 0
WHERE   UserId IN (SELECT UserId FROM aspnet_Users WHERE UserName = 'sitecore\Admin')

To unlock any other account just replace the UserName value. For example, in my case, instead of 'sitecore\Admin' it will be 'sitecore\hsingh’.

You can also look for your UserName in aspnet_Users table.

Unlock Sitecore User Account Using SQL Server

Now you can log into Sitecore using the old correct password. If you do not remember your Sitecore admin password, please refer to How To Reset The Sitecore Admin Password To b From SQL Server.

👋 Hey Sitecore Enthusiasts!

Sign up to our bi-weekly newsletter for a bite-sized curation of valuable insight from the Sitecore community.

What’s in it for you?

  • Stay up-to-date with the latest Sitecore news
  • New to Sitecore? Learn tips and tricks to help you navigate this powerful tool
  • Sitecore pro? Expand your skill set and discover troubleshooting tips
  • Browse open careers and opportunities
  • Get a chance to be featured in upcoming editions
  • Learn our secret handshake
  • And more!
Sitecore Snack a newsletter by Fishtank Consulting