Copied to clipboard

Flag this post as spam?

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


  • Nik Njegovan 4 posts 27 karma points
    Jul 29, 2014 @ 15:34
    Nik Njegovan
    0

    How can I unlock a user that has been locked out through the database with an sql script?

    I have two admins in my application that have been locked out and I want to unlock them. I have full access to the database but I cant find a isLockedOut column anywhere. 

    How does Umbraco know that a user is locked out?

  • Dirk Seefeld 126 posts 665 karma points
    Aug 14, 2014 @ 18:40
    Dirk Seefeld
    0

    Hi Nik,

    this should do the unlocking:

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

    This code uses the Management API for v6+

    Yours
    Dirk 

Please Sign in or register to post replies

Write your reply to:

Draft