//load the user by ID var user = PublicAPI.Portal.Security.User.Load(3); //lock the user account PublicAPI.Portal.Security.User.Block(user);