Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Hussein Khraibani 14 posts 86 karma points
    Sep 06, 2017 @ 22:15
    Hussein Khraibani
    0

    Reset admin password on 7.6

    Is there a way reset the admin password, in version 7.6.1 I have tried all the method that been described in previous article non of them worked.

    http://www.codeshare.co.uk/blog/how-to-reset-the-umbraco-admin-account-password/

    https://our.umbraco.org/forum/using/ui-questions/49134-Forget-My-Password-For-Umbraco-Admin-Site

    I even tried a fresh install and used the values from "userPassword" & "securityStampToken" into the locked user.

    Any reason why reset password doesn't work?

  • Aswatghi ES 2 posts 73 karma points
    Nov 12, 2020 @ 08:21
    Aswatghi ES
    0

    Yes, you can use the below code snippet for resetting the admin password

    var user = ApplicationContext.Services.UserService.GetUserById(userId);
    if (user != null)
       {
        user.Username = userName;
        user.IsApproved = true;
        user.IsLockedOut = false;                   
        ApplicationContext.Services.UserService.Save(user);                
       //Change password
       ApplicationContext.Services.UserService.SavePassword(user,userPassword);
       }
    
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies