UPDATE [aspnet_Membership] SET Password='qOvF8m8F2IcWMvfOBjJYHmfLABc='
WHERE UserId IN (SELECT UserId FROM [aspnet_Users] WHERE UserName = 'sitecore\Admin')
EDIT: Gary Jutras have propose an improved version of this sql. Thank you for it.
UPDATE dbo.aspnet_Membership SET [Password]='qOvF8m8F2IcWMvfOBjJYHmfLABc=', [PasswordSalt]='OM5gu45RQuJ76itRvkSPFw==', [IsApproved] = '1', [IsLockedOut] = '0' WHERE UserId IN (SELECT UserId FROM dbo.aspnet_Users WHERE UserName = 'sitecore\Admin')
Hi,
ReplyDeleteI tried this script for a different username, but I am still unable to logon.
Any suggestions? Thank You.
Malcolm Swan
Maybe things have changed in the two years since this was posted, but it looks like Sitecore uses unique salts for their passwords. So even if you're just resetting the password to "b" the hashed result will be different for everyone.
ReplyDeleteI can't say how many times this has saved my shiny metal posterior but thanks again. I owe you a few.
ReplyDeleteThank you really really useful!
ReplyDeleteShould actually be UPDATE dbo.aspnet_Membership
ReplyDeleteSET [Password]='qOvF8m8F2IcWMvfOBjJYHmfLABc=', [PasswordSalt]='OM5gu45RQuJ76itRvkSPFw==', [IsApproved] = '1', [IsLockedOut] = '0'
WHERE UserId IN (SELECT UserId FROM dbo.aspnet_Users WHERE UserName = 'sitecore\Admin') to also set salt and make sure not locked out
Yes good idea to update the IsLockedOut also. Thanks for the tips
ReplyDeletegetting
ReplyDeleteIncorrect syntax near 'Password'.
I'm guessing you copied the script SET... and not the
DeleteUPDATE [aspnet_Membership]
Correct syntax is
ReplyDeleteUPDATE dbo.aspnet_Membership
SET [Password]='qOvF8m8F2IcWMvfOBjJYHmfLABc=', [PasswordSalt]='OM5gu45RQuJ76itRvkSPFw==',
[IsApproved] = '1', [IsLockedOut] = '0'
WHERE UserId IN (SELECT UserId FROM dbo.aspnet_Users WHERE UserName = 'sitecore\Admin')
Thanks! It worked like a charm!
DeleteYes sorry I have updated the script!
Delete