Copied to clipboard

Flag this post as spam?

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


  • Peter Grillo Frederiksen 34 posts 67 karma points
    Sep 06, 2016 @ 06:39
    Peter Grillo Frederiksen
    0

    Admin locked out

    Hi all

    I have a bit of a problem. Yesterday I tried to login to Umbraco, but I've forgotten my password. I tried to many times, and now I've been locked out for more than 12 hours.

    I use the SQL CE database, and tried to download this file: https://our.umbraco.org/projects/developer-tools/umbraco-admin-reset/

    But it doesn't seem to work. Any ideas, what to do know?

  • Dominic Tse 21 posts 110 karma points
    Sep 06, 2016 @ 06:50
    Dominic Tse
    0

    Hi Peter,

    I have locked my account before. I reset the password by creating a new ASPX page and execute the following code in the Page_Load event. The ID is determined by umbracoUser.id column in the database.

            var userService = ApplicationContext.Current.Services.UserService;
            var newUserModel = userService.GetUserById(1);
            if (newUserModel != null)
            {
                newUserModel.RawPasswordValue = "abc";
                newUserModel.IsLockedOut = false;
                userService.Save(newUserModel, false);
            }
    

    Dom

  • Peter Grillo Frederiksen 34 posts 67 karma points
    Sep 06, 2016 @ 07:36
    Peter Grillo Frederiksen
    0

    Thank you for the suggestion Dominic.

  • Gonzalo Brusella 6 posts 76 karma points
    Apr 25, 2017 @ 18:57
    Gonzalo Brusella
    0

    Dom,

    That will set the db field with that password... Unless you have the password set to "clear" on the correct membership provider, it won't work...

    The user service has a SavePassword method that saves the password correctly (even if is hashed). See the source code on https://github.com/umbraco/Umbraco-CMS/blob/dev-v7/src/Umbraco.Core/Services/UserService.cs#L257

  • Dennis Adolfi 1082 posts 6449 karma points MVP 6x c-trib
    Sep 06, 2016 @ 06:57
    Dennis Adolfi
    102

    Hi Peter.

    If you type the wrong password to many times, your user will be locked out. You can however unlock the user by going to the database table dbo.umbracoUser, and make sure that the column userNoConsole is false/0.

    If you dont have a software for opening and edititing CE files, i recommend this free software: https://sourceforge.net/projects/compactview/

    Best of luck!

    Dennis

  • Peter Grillo Frederiksen 34 posts 67 karma points
    Sep 06, 2016 @ 07:35
    Peter Grillo Frederiksen
    1

    Thx Dennis That was the perfect solution :)

  • Dennis Adolfi 1082 posts 6449 karma points MVP 6x c-trib
    Sep 06, 2016 @ 07:43
    Dennis Adolfi
    0

    Thank you Peter, glad that i could help!

    Take care!

Please Sign in or register to post replies

Write your reply to:

Draft