-1

I reset the Sitecore Admin password from SQL using the below query:

UPDATE 
    [aspnet_Membership] 
SET 
    [Password]='qOvF8m8F2IcWMvfOBjJYHmfLABc=', 
    [PasswordSalt]='OM5gu45RQuJ76itRvkSPFw==', 
    [IsApproved] = '1', 
    [IsLockedOut] = '0'
WHERE 
    UserId IN (
        SELECT UserId FROM dbo.aspnet_Users WHERE UserName = 'sitecore\Admin'
    ) 

But now I'm geting this error: invalid length for a base-64 char array or string, when I am trying to login.

This is Sitecore 9.

1
  • The SQL you have posted there works when i tried it. Try copying into notepad and then into SQL Management studio to make sure you didn't copy any special hidden chars into that.
    – Richard Seal
    Commented Apr 4, 2019 at 10:04

2 Answers 2

1

Did you recently switch your hashing algorithm to SHA512? If so, you'll need a different password value:

USE [sitecorecmsSitecore_Core];

UPDATE 
    [aspnet_Membership] 
SET 
    [Password]='K8N8GUW8UiNT2mPdjvuBDH+QmvA3R61M9buVvCwFHwtDjpMzTxs34lg0uQ0azCITqh6FkUZlX4kM72lsAyuyXQ==', 
    [PasswordSalt]='p5B6HOWKt0ctMZaSNXTlfw==', 
    [IsApproved] = '1', 
    [IsLockedOut] = '0'
WHERE 
    UserId IN (
        SELECT UserId FROM dbo.aspnet_Users WHERE UserName = 'sitecore\admin'
    );
-4

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')

This worked properly for me.

1
  • You have just posted the same SQL as in the original question.
    – Richard Seal
    Commented Apr 4, 2019 at 10:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.