May 27, 2008 - DotNetNuke    Comments Off on DotNetNuke Password Reset via SQL (Option 2)

DotNetNuke Password Reset via SQL (Option 2)

I was looking to reset a password in DotNetNuke 4.4.1 and found this link:
[url:3o7542n6]http://support.ihostasp.net/Customer/KBArticle.aspx?articleid=44[/url:3o7542n6]

Apparently this is for a prior version, as the 4.4.1 stored procedure uses the "ApplicationName" and not the "ApplicationID". I was successful in resetting the password using the small modification found below.

[code:3o7542n6]
Declare @UserName NVarChar(255)
Declare @NewPassword NVarChar(255)
Declare @PasswordSalt NVarChar(128)
Declare @Application NVarChar(255)
— Enter the user name and new password between ”
— Do not leave any spaces unless intended to do so.
— Edit only between single quote characters
Set @UserName = ‘host’ — This default DNN host user
Set @NewPassword = ‘yourpasswordhere’ –New password
— Do not modify any code below this line
Set @Application = (SELECT [ApplicationName] FROM aspnet_Users inner join aspnet_Applications on aspnet_Users.ApplicationId = aspnet_Applications.ApplicationId 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, 0, null[/code:3o7542n6]