DotNetNuke 4.4.1 Password Reset Via SQL.

I was looking to reset a password in DotNetNuke 4.4.1 and found this link:

http://support.ihostasp.net/Customer/KBArticle.aspx?articleid=44

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.

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 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

Category: