Sitecore Admin Password Locked? Here’s How to Unlock It

     Unlocking the Sitecore admin password can be crucial if you find yourself locked out of your Sitecore instance. Here’s a detailed guide on how to unlock the Sitecore admin password using various methods.

Method 1: Using the unlock_admin.aspx Page

This method involves using a special ASPX page provided by Sitecore to unlock the admin account.

  1. Copy the ASPX File:

    • Locate the unlock_admin.aspx file in your Sitecore installation package.
    • Copy this file to your Website\sitecore\admin folder, overwriting the existing file if necessary.
    • Access the page cm.domain/sitecore/admin/unlock_admin.aspx 


  2. Update web.config:

    • Open your web.config file located in the root Website folder.
    • Ensure it contains the following settings:

  3. Access the Unlock Page:
  • Navigate  to https://YourSitecore.com/sitecore/admin/unlock_admin.aspx.
  • Click the "Unlock Administrator" button.
  • You should now be able to log in to your Sitecore instance.

Method 2: Using SQL Server

If you have access to the SQL Server database, you can unlock the admin account directly by modifying the database.

  1. Access SQL Server:

    • Open SQL Server Management Studio (SSMS) and connect to your Sitecore database server.
    • Navigate to the website_Core database.
  2. Modify dbo.aspnet_membership Table:

    • In the dbo.aspnet_membership table, locate the rows where the IsLockedOut column is set to 1 and the Comment column says "Sitecore Administrator".
    • Update the IsLockedOut column to False.

    Example SQL query:

Method 3: Programmatically Reset Password

You can also unlock the admin account and reset the password programmatically using a script.

  1. Use the Following Script:
    • Create a script in your Sitecore solution to unlock the user and reset the password.

    • Example C# script:


    • This script will unlock the user and reset the password to b.

Method 4: SQL Query to Reset Password

Another method involves directly resetting the password using an SQL query.

  1. Run SQL Query:
    • Execute the following SQL query to reset the admin password to b:


    • This query works on all versions of Sitecore.

Conclusion

These methods provide different ways to unlock the Sitecore admin password, whether through the Sitecore interface, SQL Server, or programmatically. Choose the method that best suits your access level and technical comfort.

Happy Unlocking..!! 😀 😀

Comments