Skip to main content

Change a User's Password in ASP.NET Membership when you don't know the original password

I ran into a situation where I needed to regain access to a site using ASP.NET membership security, but I'd lost the passwords to the user accounts, the security questions were not implemented, and the password reset email did not work either. This article from StackOverflow helped regain access to the site.

http://stackoverflow.com/questions/287320/how-do-you-change-a-hashed-password-using-asp-net-membership-provider-if-you-don

MembershipUser u = Membership.GetUser();
u.ChangePassword(u.ResetPassword(), "myAwesomePassword");

Comments

Popular posts from this blog

Adventures in moving SQL Server system databases

I recently completed the task of moving the system databases of a Microsoft SQL Server 2008 instance to a different drive letter.  The whole process is described in a brief document on MSDN .  It is literally just a few SQL commands, a few moves of some files, and a restart of the services.  In my case, it all went pretty smoothly until

How to Debug Local VBScript

For a long time, I didn't know any better way to "debug" a VBScript than to find where it blew up from the error message and put MsgBox() statements right before it. Eventually I needed a better way, and I found this quick and easy tip. Open command window <cscript|wscript> <file.vbs> //X Now when the script throws an error, you have the opportunity to run the script debugger such as Visual Studio 2010. In my case, it I use Visual Studio Professional, but I think it will work with the Express Editions as well.