Geeks With Blogs

Tim Huffam Dotting the I and crossing the T of I.T.

If you're a plonker like me and have forgotten a password, you have 2 options:

  1. Call the 'aspnet_Membership_ResetPassword' sproc.
  2. Simply update the aspnet_membership table manually by copying the password and passwordSalt column values from another user (whose password you know).  Here's some code I used:

declare @u uniqueidentifier
set @u = (select userid from aspnet_users where username = 'userwhosepswdyouknow')

UPDATE aspnet_Membership
SET
  [Password] = (select password from aspnet_membership where userid = @u),
  [PasswordSalt] = (select passwordsalt from aspnet_membership where userid = @u)
WHERE userid = (select userid from aspnet_users where username = 'userwhosepswdyoudontknow')

select password, passwordsalt from aspnet_membership m

HTH

Tim

 

Posted on Wednesday, September 28, 2005 7:31 PM C# .NET , SQL Server , ASP.NET , DotNetNuke (DNN) | Back to top


Comments on this post: Resetting DNN or asp.net membership password and password salt

# re: Resetting DNN or asp.net membership password and password salt
Requesting Gravatar...
Hi, My name is Paige, and I'm a plonker....

Thanks for much, this was very helpful.
Left by Paige on Jan 02, 2007 3:00 PM

# re: Resetting DNN or asp.net membership password and password salt
Requesting Gravatar...
Hi, My name is Martijn, and I'm a plonker...
Thanks, you saved my day!
Left by Martijn on Mar 13, 2007 7:36 PM

# Resetting DNN or asp.net membership password and password salt
Requesting Gravatar...
I am a big plonker...  this really helped me!FFrom: http://geekswithblogs.net/timh/archive/2005/09/28/55414.aspxIf you're a plonker like me and have forgotten a password, you have 2 opt ...
Left by Darkware, Inc. Blog on Apr 17, 2007 10:49 AM

# re: Resetting DNN or asp.net membership password and password salt
Requesting Gravatar...
large plonker
thanks
Left by Saj on Apr 11, 2008 3:08 AM

# re: Resetting DNN or asp.net membership password and password salt
Requesting Gravatar...
Thank you very much. You helped me a lot.
Left by Blackberry on Sep 24, 2008 5:57 PM

# re: Resetting DNN or asp.net membership password and password salt
Requesting Gravatar...
Over time wont doesn't this have the potential to make all the PasswordSalt values the same, thereby introducing a security risk?
Left by Dream Dictionary on Aug 12, 2010 8:11 AM

Your comment:
 (will show your gravatar)


Copyright © Tim Huffam | Powered by: GeeksWithBlogs.net