You can reset host password by beloq sql procedure
CREATE 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
GO
CREATE 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
GO
No comments:
Post a Comment