Try our conversational search powered by Generative AI!

Locking unused accounts


I've been trying to figure out a way to block accounts that have not been used for 3 months. I've found a way to check last login date, but I'm having difficulties understanding how to mark the account as locked. I've been looking through the EPiServerProfile, but there is only a way to check if the account IS locked and unlock, not locking it.

Any ideas?

Sep 22, 2010 12:22


            System.Web.Security.Membership.GetUser("username").IsApproved = false;

Maybe something something like this will work (not tried it myself):  



            MembershipUser user = System.Web.Security.Membership.GetUser("username");

            user.IsApproved = false;




Edited, Sep 22, 2010 15:11

This probably works in making the account unusable, but it does not set the IsLockedOut property to true. This is what I'm looking for.

Sep 27, 2010 12:52
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.