Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 17, 2008 10:56 PM by jjkky
Member
11 Points
32 Posts
Dec 17, 2008 01:15 PM|LINK
I evidently forgot the admin password after I changed it. Is there a way to recover it.
My code doesn't not have a recover password option. Is there a back door to re-create an admin account? I don't want to rebuild what I've modified.
Thanks!
All-Star
21838 Points
4822 Posts
Dec 17, 2008 03:33 PM|LINK
I have not used the Personal Site Starter kit but here a few things you can try:
1. You can start the Website Configuration tool and delete the Admin account and create it again.
or
2. Reset the password from code.
This is what I do to reset passwords. protected void uxResetPassword_Click(object sender, EventArgs e) { if (uxNewPassword.Text.Length == 0) { uxMessage.Text = "New Password field cannot be empty."; return; } string username = uxUserList.SelectedItem.Text; string password = uxNewPassword.Text; try { MembershipUser userInfo = Membership.GetUser(username); userInfo.ChangePassword(userInfo.ResetPassword(), password); userInfo.Comment = "Change Password"; Membership.UpdateUser(userInfo); uxMessage.Visible = true; uxMessage.Text = "Password reset successful."; } catch (System.Exception ex) { uxMessage.Visible = true; uxMessage.Text = "Password reset failed.<br />"; uxMessage.Text += ex.Message; } }
<asp:ObjectDataSource ID="UserData" runat="server" TypeName="System.Web.Security.Membership" SelectMethod="GetAllUsers" /> <asp:DropDownList ID="uxUserList" runat="server" DataSourceID="UserData" DataKeyNames="UserName" /> <asp:TextBox ID="uxNewPassword" runat="server" TextMode="Password"></asp:TextBox> <asp:Button ID="uxResetPassword" runat="server" Text="Reset" onclick="uxResetPassword_Click" />
Dec 17, 2008 10:56 PM|LINK
Thanks! Don't know why I didn't think of the config mgr. That fixed my problem....
jjkky
Member
11 Points
32 Posts
Admin password
Dec 17, 2008 01:15 PM|LINK
I evidently forgot the admin password after I changed it. Is there a way to recover it.
My code doesn't not have a recover password option. Is there a back door to re-create an admin account? I don't want to rebuild what I've modified.
Thanks!
bullpit
All-Star
21838 Points
4822 Posts
Re: Admin password
Dec 17, 2008 03:33 PM|LINK
I have not used the Personal Site Starter kit but here a few things you can try:
1. You can start the Website Configuration tool and delete the Admin account and create it again.
or
2. Reset the password from code.
This is what I do to reset passwords. protected void uxResetPassword_Click(object sender, EventArgs e) { if (uxNewPassword.Text.Length == 0) { uxMessage.Text = "New Password field cannot be empty."; return; } string username = uxUserList.SelectedItem.Text; string password = uxNewPassword.Text; try { MembershipUser userInfo = Membership.GetUser(username); userInfo.ChangePassword(userInfo.ResetPassword(), password); userInfo.Comment = "Change Password"; Membership.UpdateUser(userInfo); uxMessage.Visible = true; uxMessage.Text = "Password reset successful."; } catch (System.Exception ex) { uxMessage.Visible = true; uxMessage.Text = "Password reset failed.<br />"; uxMessage.Text += ex.Message; } }Max
Let Me Google That For You!
jjkky
Member
11 Points
32 Posts
Re: Admin password
Dec 17, 2008 10:56 PM|LINK
Thanks! Don't know why I didn't think of the config mgr. That fixed my problem....