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?

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 search by picked multi node tree picker values in Umbraco v8

This post shows you how you can use examine to search for articles which have the category picked in…

Read Post

How to enable AMP in Umbraco 7 Websites

This post shows you how I set up AMP in my Umbraco 7 website

Read Post

How to render the actual document type icons in the tree in Umbraco

This post gives you the code to be able to see the icons for your document types in the tree view ra…

Read Post

How to animate tree icons in Umbraco v8

This post shows you how you can change the colour and animate tree icons in Umbraco based on a prope…

Read Post