Register
Friday, July 30, 2010
DnnForge - NewsArticles

Current Articles | Categories | Search | Syndication

Saturday, August 29, 2009
Change DNN Password from the database
By drfranco @ 9:48 AM :: 368 Views :: 0 Comments :: :: DotNetNuke
 

 I needed to reset the host account in a newly aquired DNN site. Since I couldn't login to the site from the web front end I needed a way to do it from the database. These quick steps got me back in business.

First create a stored procedure by running this query on your database.

ALTER procedure [dbo].[uap_ResetPassword]
@UserName NVarChar(255),
@NewPassword NVarChar(255)
as
begin
Declare @PasswordSalt NVarChar(128)
Declare @ApplicationID NVarChar(255)
Declare @ApplicationName NVarChar(255)

Set @ApplicationID = (SELECT [ApplicationID] FROM aspnet_Users WHERE UserName=@UserName)
Set @ApplicationName = (SELECT [ApplicationName] FROM aspnet_Applications WHERE ApplicationID=@ApplicationID)
Set @PasswordSalt = (SELECT PasswordSalt FROM aspnet_Membership WHERE UserID IN (SELECT UserID FROM aspnet_Users WHERE UserName=@UserName))

select @ApplicationID, @ApplicationName
declare @RetVal as int
Exec @RetVal = dbo.aspnet_Membership_ResetPassword @ApplicationName, @UserName, @NewPassword, 10, 10, @PasswordSalt, -5
return @RetVal

end
 

After creating that stored procedure you can then run this command to change the password on any user account in the database.

uap_ResetPassword username, newpassword

Rating
Comments
Currently, there are no comments. Be the first to post one!
Click here to post a comment
   
Privacy Statement   |   Terms Of Use Copyright 2007 by francoconnection.com