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.
Maybe something something like this will work (not tried it myself):
MembershipUser user = System.Web.Security.Membership.GetUser("username");
user.IsApproved = false;
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.