Incorrect service account credentials
Published 21 October 2021
If SQL Monitor is configured to authenticate users with Active Directory, and you're locked out of your Active Directory service account, you may be able to Edit the entry in the Windows Credential Manager associated with it, which will be in the form SQL_Monitor_AD_ServiceAccount_<Domain>. If that doesn't exist for some reason or does not work, you will need to switch the authentication mode back to the default, remove the entries for the domains that have been added, restart the Web Service (or website, if you're using IIS), and then switch back to Active Directory authentication.
For editing the entry in Windows Credential Manager do this:
- Open Control Panel to show All Control Panel Items, and then open Credential Manager: note that you will need to run this as the user SQL Monitor runs as.
- Click on Windows Credentials.
- Find the entry for your service account under the Generic Credentials section.
It will be in the form SQL_Monitor_AD_ServiceAccount_<Domain> like this:
(Note: there may be a legacy entry, SQL_Monitor_AD_ServiceAccount, from versions before multiple AD domains were added that will be fallen back to for the first domain) - Expand the entry and click Edit to update the password.
If that is not present, you won't be able to log in to SQL Monitor (even as an administrator) to switch the authentication mode back to the default. Instead, you need to run a SQL script to do this.
- Switch the authentication mode back to the default:
- In Management Studio, connect to the SQL Server instance that hosts the SQL Monitor database.
Paste the following SQL script into a new query window, targeted at the data repository (RedGateMonitor database by default):
DELETE FROM [settings].[KeyValuePairs] WHERE [KeyName] = 'AuthenticationType'; DELETE FROM settings.ActiveDirectoryDomains;
Run the script.
Restart the Web Service (or website, if you're using IIS).
To restart the Web Service: from the Start menu, open Services, right-click SQL Monitor Web Service, and select Restart.
To restart the website (if you're using IIS): open IIS Manager and, under Connections, right-click the website SQL Monitor uses. Click Manage Website, and select Restart.- Switch back to Active Directory authentication.