Reset Umbraco user passwords - code free!

The number of times I get access to a project to work on locally without knowing the admin password, you wouldn't believe! And every time, I forget the steps to enable a password reset!

, by Joe Glombek

It's got a lot simpler to reset an admin's password in modern Umbraco. You used to have to mess with hashes in the database and before that, drag a mysterious DLL into your bin folder!

But now, it's simpler than ever to initiate a password reset - via the UI! It's a simple matter of clicking the "Forgotten password?" link on the Umbraco login screen.

Unless...

No "Forgotten password?" link?

To enable password reset you'll need the following appsettings (set them in User Secrets if you only want it locally):

{
  "Umbraco": {
    "CMS": {
      "Security": {
        "AllowPasswordReset": true
      }
    }
  }
}

(Umbraco docs)

No access to the email inbox?

If you've not got access to the admin email address, you can set up a local SMTP server. I like to use smtp4dev these days.

{
  "Umbraco": {
    "CMS": {
      "Global": {
        "Smtp": {
          "From": "noreply@example.com",
          "Host": "localhost"
        }
      }
    }
  }
}

Don't know the admin email?

If you don't even know the admin email, you'll need to look in the database (sorry, not quite codeless!):

SELECT userLogin, userEmail
  FROM [umbracoUser]
  -- Optionally, this returns the original admin account. Delete the following to see all users:
  WHERE id <= 0

Thanks to Sebastiaan Janssen for his correction.