Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Jeff Wallace
Apr 3, 2012
  9944
(0 votes)

Forcefully Unlock Administrative User in EPiServer Commerce

Based on CMS 6 R2, Commerce 1 R2 SP1 (or SP2), and SQL Server 2008

 

So you went on vacation (or holiday depending on your country’s term for that time we all look forward to), had a long weekend, or just did a fresh install of EPiServer Commerce and either totally forgot or have no idea what your administrator users password is.  You try logging in with a variety of your favorite passwords without luck.  Unfortunately you realize you probably did this too many times and can no longer log in because your account has been locked due to excessive failed login attempts.  This is also the moment where you realize you probably should have created two or more admin users.  Oops!  If you have access to the database, have no fear, you can undo your wrong, get back to work, and not feel guilty having a few beers again next weekend and forgetting that password all over again.  Winking smile

 

Please note, the EPiServer Commerce Manager allows you to unlock users through the backend user interface which is the most typical approach in a real environment. This is for the case where you’ve locked your only administrator account, likely in a new install, demo environment, or something comparable.

 

  • Log into SQL Server Management Studio (assuming you’ve installed it, otherwise you’ll need to open up your favorite command line tool).
  • Navigate to the Commerce Manager database for the site with the locked user.
  • Expand the database and the “Tables” node.

clip_image001

  • Navigate to the “aspnet_Membership” table
  • Select the option to “Edit Top 200  Rows”.  (If you have more than 200 users use your preferred standard SQL methods to get to the locked user).

clip_image002

  • Locate the locked user and scroll the table to the right to find the “IsLockedOut” field.  If the user is locked it will be set to “True”.
  • Change this field to “False”

image

  • You should now be able to go back to your site and log in.

 

Cheers!

Apr 03, 2012

Comments

Apr 3, 2012 05:51 PM

If you forgot the password completely you can also use the stored procedure to set it to whatever you want: aspnet_Membership_SetPassword

Set the PasswordFormat to 0, to be able to pass in a clear text password:
exec aspnet_Membership_SetPassword
N'CommerceManager',
N'admin',
N'store',
N'',
(SELECT GETUTCDATE()),
0

Apr 3, 2012 05:57 PM

Nice addition Tobias!

Apr 3, 2012 07:44 PM

Thanks for doing this, Jeff. And thanks for the added bonus, Tobias.

Justin Le
Justin Le May 20, 2015 10:17 AM

Thanks! noted to self

Please login to comment.
Latest blogs
Solving the mystery of high memory usage

Sometimes, my work is easy, the problem could be resolved with one look (when I’m lucky enough to look at where it needs to be looked, just like th...

Quan Mai | Apr 22, 2024 | Syndicated blog

Search & Navigation reporting improvements

From version 16.1.0 there are some updates on the statistics pages: Add pagination to search phrase list Allows choosing a custom date range to get...

Phong | Apr 22, 2024

Optimizely and the never-ending story of the missing globe!

I've worked with Optimizely CMS for 14 years, and there are two things I'm obsessed with: Link validation and the globe that keeps disappearing on...

Tomas Hensrud Gulla | Apr 18, 2024 | Syndicated blog

Visitor Groups Usage Report For Optimizely CMS 12

This add-on offers detailed information on how visitor groups are used and how effective they are within Optimizely CMS. Editors can monitor and...

Adnan Zameer | Apr 18, 2024 | Syndicated blog