Advertisement
Guest User

Untitled

a guest
Sep 17th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. Declare @UserName NVarChar(30)
  2. Declare @Password NVarChar(30)
  3. Declare @Application NVarChar(255)
  4. Declare @PasswordSalt NVarChar(128)
  5.  
  6. set @UserName = 'AUSER' /* a user from aspnet_Users table*/
  7. set @Password = 'AUSER_PASSWORD' /* set a password */
  8. set @Application = 'MyApplication' /* from aspnet_Applications table, multiple apps can exist */
  9. Set @PasswordSalt = (SELECT 1 PasswordSalt FROM aspnet_Membership WHERE UserID IN (SELECT UserID FROM aspnet_Users u, aspnet_Applications a WHERE u.UserName=@UserName and a.ApplicationName = @Application AND u.ApplicationId = a.ApplicationId))
  10.  
  11. Exec dbo.aspnet_Membership_ResetPassword @Application, @UserName, @Password, 10, 10, @PasswordSalt, -5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement