Skip to content

Instantly share code, notes, and snippets.

@grant-killian
Last active May 5, 2017 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grant-killian/d2c17ec90adc4b1b99b6089172268571 to your computer and use it in GitHub Desktop.
Save grant-killian/d2c17ec90adc4b1b99b6089172268571 to your computer and use it in GitHub Desktop.
Example of how we would reset the sitecore\admin password after changing the Membership hash algorithm
<%@ Page Language="C#" AutoEventWireup="true" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
MembershipUser user = Membership.GetUser(@"sitecore\admin", false);
/*
ResetPassword calls the MembershipProvider.ResetPassword method of the membership provider referenced by the ProviderName
property to reset the password for the membership user to a new, automatically generated password.
The new password is then returned to the caller.
*/
string pwd = user.ResetPassword();
Response.Write("<h2>Password reset to <i>" + pwd + "</i></h2>");
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment