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 include scripts from partial views in MVC and Umbraco

This post will show you how you can include scripts from inside an MVC partial view rather than havi…

Read Post

How to fix the error "Authentication failed because the remote party has closed the transport stream"

This post will show you how to fix the error "Authentication failed because the remote party has clo…

Read Post

How to solve the error Could not load file or assembly System.Security.Principal.Windows

This post help you solve the error System.IO.FileNotFoundException Could not load file or assembly S…

Read Post

How to ignore a file locally in git without ignoring it from the repository

This post shows you how you can ignore a file in git locally without ignoring it from the repository…

Read Post