Resetting users password

If you are the "administrator" or someone with a similar role and you want to reset your users password, here is what I do:

Create a custom Action accessible to administrators only

Create a business role with following code:

MembershipUser user = Membership.GetUser(username);
if (user != null)
string pw = "p@ssword123";
user.ChangePassword(user.ResetPassword(), pw);

Result.ExecuteOnClient("alert('Password for the user "+ username +" successfully reset')");
Result.ExecuteOnClient("alert('User does not exist for the employee "+ name +"')");

Hope this will help someone out there
2 people like
this idea