Friday, November 27, 2009

Resetting DNN passwords

Yesterday me and my team came across a strange problem, we had a client DNN deployment on our server for demo, and for long the client was not interested or was too busy and suddenly he needs the see the site the problem the original developer was not available and no one else know the host or admin password 


Luckily one of my team member were able to find a post with solution, i am re- posting the procedure.

CREATE procedure [dbo].[uap_ResetPassword]
@UserName NVarChar(255),
@NewPassword NVarChar(255)
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


Orignal post:

Thanks Tony...

kick it on

No comments: