What's the story?

It has happened to most of us when working with Umbraco, you can't remember the login details for the main admin account. You didn't realise when you were entering the details on the setup screens, you were entering username and password details that you would need it later to log in to Umbraco.

This post gives you 4 simple steps to help you reset the Umbraco admin password.

Step 1

Open SQL Server Management Studio
Create a new query using the database for your umbraco project. Copy and paste the following SQL:

UPDATE umbracoUser SET userdisabled = 0, userLogin = 'admin', userPassword = 'default' WHERE id = 0

Run the query. This has now made sure the admin account is enabled and and set the password to 'default'.

This won't work yet though as passwords are stored as hash values, so you need to edit a setting in the web.config file temporarily.

Step 2

In the web.config file, at the root of your web project, use Ctrl+F to find UsersMembershipProvider

The passwordFormat will be set to "Hashed". You need to change it to "Clear" so that you can login. Save the web.config file.

Step 3

Go to the umbraco login page and login with the username of admin and the password of default.

Once you have logged in, you need to change the passwordFormat in the web.config again back to "Hashed" and press Save.

Step 4

Now you can change the password for the admin user to a different one and it will be saved in the database with a hashed value instead of clear text.

To make sure it is storing passwords in the hashed format, run this SQL query after you have changed the password.

SELECT userName, userPassword FROM umbracoUser WHERE id = 0

You should see the admin username and the hashed password.

UPDATE

Since publishing this post, I have found there is an even easier way to reset the admin password. You can just add a dll to the bin folder. See this package

Want to thank me?

If I've helped you out and you want to thank me, why not buy me a coffee?

About the author

Paul Seal

Umbraco MVP and .NET Web Developer from Derby (UK) who specialises in building Content Management System (CMS) websites using MVC with Umbraco as a framework. Paul is passionate about web development and programming as a whole. Apart from when he's with his wife and son, if he's not writing code, he's thinking about it or listening to a podcast about it.

Related Posts

How to fix corrupt accented characters in Excel for a C# export as CSV

This post will help you fix the issue where you csv export has corrupt characters when opening it in…

Read Post

How to create a dynamic image from multiple images using ImageProcessor

This post shows you how I created a handler to create dynamic header images for my umbraco website u…

Read Post

How to send Slack messages programmatically using C#

In this post I show you how you can send Slack messages programmatically using C#

Read Post

How to fix the SVG 404 error when using Umbraco and Azure Blob Storage

In this post I show you how to solve the SVG 404 error when working with Umbraco and Azure Blob Stor…

Read Post