Friday, January 8, 2021

Admin password

 

Reset admin password

https://sitecore.stackexchange.com/questions/280/is-there-a-way-to-reset-sitecore-admin-password-from-database-level

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

The accepted answer is valid for previous version of Sitecore, but it does not reset the password salt and doesn't in fact reset the password to 'b'. In order to do this, you need the following script (which also will unlock the admin user if locked):

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


Get default Sitecore admin password of CM set by .ps1

For Sitecore 9.1+, check “XP0-SingleDeveloper.ps1” file which is having a parameter of “$SitecoreAdminPassword“.
Default value is “SIF-Default” which means it will generate the random password of Sitecore admin user.

To know the password, open “XP0-SingleDeveloper.log” file which will be generated in the folder from where you installed Sitecore instance. Search for “Sitecore Admin Password” in the log file.

2. Set the password as per your requirement

In Sitecore installation script “XP0-SingleDeveloper.ps1“, specify value of “$SitecoreAdminPassword” parameter and so the default admin password will be set as per your requirement. In my example, i have set CM admin password as “vinc“.

In this way, you can manage the default password for Sitecore 9.1 instance.

Happy Sitecoring!!

No comments:

Post a Comment