Unable to access administrator account
Published 07 October 2020
If SQL Monitor is configured to authenticate users with Active Directory, and you're locked out of your Active Directory administrator account – for example, if the administrator leaves the company – you need to manually add a new administrator to the SQL Monitor database.
- 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:
Script to add new administrator
INSERT settings.AuthPrincipals (Name, PrincipalType, PrincipalRole, [All], AuthenticationType ) VALUES (N'user.name@example.com', 1, -- PrincipalType - 1 = User, 2 = Group 1, -- PrincipalRole - 1 = Administrator, 2 = Standard user 1 -- All, 2 -- Active Directory )
Replace
user.name@example.com
with the user or group you want to use as the SQL Monitor administrator account. It must be an existing Active Directory user or group.
If you're adding a group, don't include@example.com.
If you're adding a user group, change the
PrincipleType
value to2
.For example:
INSERT settings.AuthPrincipals (Name, PrincipalType, PrincipalRole, [All], AuthenticationType ) VALUES (N'groupname', 2, -- PrincipalType - 1 = User, 2 = Group 1, -- PrincipalRole - 1 = Administrator, 2 = Standard user 1 -- All, 2 -- Active Directory )
Run the script.