Are you trying to reset a password in DNN?
Thursday, January 27, 2011 11:09 PM
Are you trying to reset your admin or host password in DNN? I think I can help you out!
I'm working on a community user group DNN website and I did something screwy. I mucked up the host and admin accounts! DOH! Yup, I mean I REALLY screwed them up, so much that I couldn't log in with neither of them! DOH!
You know that feeling eh? You look at the Users and aspnet_membership tables and see nothing in return? (Palm meet forehead, SMACK! DOH!) Oh the ache in the PIT of your stomach eh?
Thankfully I DO have SQL Server Management Studio access to the DB! PHEW! But when I google for solutions I get things like this, which JUST WEREN'T working for me!
create procedure uap_ResetPassword
Declare @PasswordSalt NVarChar(128)
Declare @Application NVarChar(255)
Set @Application = (SELECT [ApplicationID] FROM aspnet_Users WHERE UserName=@UserName)
Set @PasswordSalt = (SELECT PasswordSalt FROM aspnet_Membership WHERE UserID IN (SELECT UserID FROM aspnet_Users WHERE UserName=@UserName))
Exec dbo.aspnet_Membership_ResetPassword @Application, @UserName, @NewPassword, 10, 10, @PasswordSalt, -5
I did this but when I tried to log in with the host or admin accounts, STILL NO DICE! DOH! OH man, pit in stomach feeling getting worse! DOH!
But then I came across these two sql scripts which DID work for me. They have ONE key assumption, you have to know the password to at least ONE account. Ok, that's not so bad, why? Cause you can always Register a new user and steal THAT password and salt values.
First sql helps get you the fields you need to cut'n'paste into the second script. Just change the 'admin' in the username line to the username of the password you DO know for sure!
SELECT password, passwordformat, passwordsalt
FROM aspnet_membership am
INNER JOIN aspnet_users au
ON (au.userid = am.userid)
INNER JOIN aspnet_applications aa
ON (au.applicationId = aa.applicationid)
WHERE au.username = 'admin'
AND aa.applicationname = 'DotNetNuke'
Next, cut'n'paste the
DECLARE @changeDate datetime
set @changeDate = getdate()
Ok, after doing this magic and slight of hand, I was BACK IN BUSINESS! COOL!
Now that I can administrate the website again, it's time to grab a coffee and get coding!
AQUEST Hosting: Reset Password for ASP.Net 2.0 Membership (working solutio for me)
Ottawa IT Community user groups umbrella website
devprise.com: How to reset a DNN password at the Database (didn't work for me, not sure why?)