Last active
May 5, 2017 21:19
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ 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