Applies to: Applications Manager on Windows, connecting to SQL Server with a Group Managed Service Account (gMSA) - as the back-end database at installation time, or as an MS SQL monitor.
This guide covers the errors Applications Manager reports when a gMSA connection fails, what each one means, and the steps to resolve it.
Three things about the way the product uses a gMSA explain most of the failures below.
integratedSecurity=true). The connection therefore authenticates as whatever account the Applications Manager service runs as. If that is not the gMSA, nothing else in this article will help.sqlcmd on the SQL Server host as the gMSA, through PsExec:
<APM_HOME>\PSTools\PsExec.exe \\<sql_server> -u <domain>\<gmsa>$ -p ~ sqlcmd -S <sql_server> -d master -Q "<query>"
~ is a placeholder, not a password: a gMSA password is managed by Active Directory and is never typed. The product reports the result purely from the exit code of that command, and prints the command it ran, so you can repeat it by hand.A gMSA connection still uses Kerberos underneath. If the errors point at tickets, SPNs or realms rather than at the account itself, use How do I troubleshoot SQL Server Kerberos configuration issues? alongside this article.
| Message | Where it appears | Section |
|---|---|---|
| To verify SQL connectivity using the provided gMSA account, PsExec.exe from the PSTools suite is required | Installation, Self-Help tool | 3.1 |
| Connection to the SQL Server using the provided gMSA account via PowerShell has failed | Installation, Self-Help tool | 3.2 |
| Invoke-Sqlcmd is not recognized as the name of a cmdlet | Manual PowerShell test | 3.3 |
| Test-ADServiceAccount returns False | PowerShell on the Applications Manager host | 3.4 |
| Native authentication/gMSA account is supported only on Windows based Applications Manager Installation | Self-Help tool | 3.5 |
| Access denied when the service starts | Windows service control manager | 4.1 |
| Integrated authentication failed ... Cannot get any of properties: [user, USER] | StartUpLogs_out.txt | 4.2 |
| Windows authentication with the configured service account failed | MS SQL monitor using Native authentication | 4.2 |
| Unable to login with database 'AMDB' due to SQL authentication failure | StartUpLogs_out.txt | 4.3 |
| Please verify that the service account is correct and ensure that this account has the required permissions | Self-Help tool, monitor error | 4.3 |
What it means: the gMSA check could not run at all. Applications Manager does not ship PsExec, and it was not found in the installation folder.
Resolution: download the PSTools package from Microsoft and place PsExec.exe at <APM_HOME>\PSTools\PsExec.exe, then continue the installation. If PsExec has never been run on this host, accept its licence agreement once by running it manually - it waits for that agreement on first use, which otherwise looks like a hang.
What it means: the PsExec command returned a non-zero exit code. Applications Manager reports the failure from that exit code alone, so the message says nothing about the cause - the cause is in the output of the command itself, which is why the message prints the exact command it ran.
Resolution: run that command by hand, from <APM_HOME> in an elevated command prompt, and read what it says. The common answers:
| What the command says | What to do |
|---|---|
| Access is denied / the user name could not be found | The gMSA is not usable on this host. Go to 3.4. |
| Login failed for user '<domain>\<gmsa>$' | The account reached SQL Server and has no login there. Go to 4.3. |
| sqlcmd is not recognized | The SQL Server command line utilities are not installed on the SQL Server host. Install them, or test with Invoke-Sqlcmd as in 3.3. |
| The network path was not found / could not start PsExec service | PsExec could not reach the SQL Server host. It needs file and printer sharing (TCP 445) and administrative rights on that host. |
| Nothing, and it waits | The PsExec licence agreement has not been accepted on this host. Accept it once, then retry. |
A named instance is tested as -S <sql_server>\<instance>. If the instance name is wrong, this is where it shows.
What it means: this is a missing PowerShell module on the machine you are testing from, not an authentication problem.
Resolution:
Install-Module -Name SqlServer
Import-Module SqlServer
Get-Command Invoke-Sqlcmd
Then test the connection as the gMSA. Open a PowerShell window running as the account, and query from it:
<APM_HOME>\PSTools\PsExec.exe -i -u <domain>\<gmsa>$ -p ~ powershell.exe
Invoke-Sqlcmd -ServerInstance '<sql_server>' -Database 'master' -Query 'select getdate()'
What it means: this host cannot retrieve the account's managed password, so it cannot run anything as the gMSA. Two separate things are needed: the domain must allow this host to retrieve the password, and the account must be installed on the host.
Resolution. On a domain controller, or any machine with the Active Directory PowerShell module and the rights to use it:
Set-ADServiceAccount -Identity <gmsa> -PrincipalsAllowedToRetrieveManagedPassword "<host>$"
Get-ADServiceAccount <gmsa> -Properties PrincipalsAllowedToRetrieveManagedPassword | Select-Object PrincipalsAllowedToRetrieveManagedPassword
The second command must list the machine account of the Applications Manager host, ending in $. To add a host without replacing the existing list, pass every host that needs it to Set-ADServiceAccount, since the parameter replaces rather than appends.
Then, on the Applications Manager host itself, in an elevated PowerShell:
Install-ADServiceAccount <gmsa>
Test-ADServiceAccount <gmsa>
Test-ADServiceAccount must return True before anything else in this article can work. If it still returns False immediately after the change, the host's Kerberos ticket is older than the change: restart the host, or wait for replication to reach the domain controller it is using.
What it means: exactly what it says - the installation is on Linux. A gMSA depends on Windows retrieving the managed password from Active Directory, which has no equivalent here.
Resolution: use Kerberos authentication with a keytab instead, which is supported on Linux. See Enabling Kerberos Authentication for SQL Server in Applications Manager.
What it means: Windows refused to start the service as the gMSA. The account has not been granted the right to log on as a service.
Resolution:
gpedit.msc on the Applications Manager host and go to Local Computer Policy → Computer Configuration → Windows Settings → Security Settings → Local Policies → User Rights Assignment.<DOMAIN>\<gmsa>$, including the $.services.msc, open the Applications Manager service, Log On tab, enter <DOMAIN>\<gmsa>$ and leave both password boxes empty.If the policy is managed centrally, a domain policy may overwrite a local change at the next refresh. In that case the right has to be granted in the domain policy that applies to this host.
What it means: the connection was made with no user name and no password, as a gMSA connection is meant to be, and the process had no Windows identity that SQL Server would accept. Either the service is not running as the gMSA, or the account it is running as has no login on SQL Server.
Resolution:
services.msc, the Log On As column. A service left on Local System authenticates as the machine account, not as the gMSA, and this is the most common cause.The same message on an MS SQL monitor. A monitor added with Native authentication fails the same way and for the same reason, with one thing worth knowing: the identity used is the Applications Manager service account, not anything entered on the monitor. A monitor cannot carry a gMSA of its own. So the first check is the same - which account the service runs as - and the second is whether that account has a login on the monitored instance (4.3).
Applications Manager cannot start while it cannot reach its own database, so the product stays down until this is resolved. If it must be brought up before then, revert <APM_HOME>\working\conf\database_params.conf to the authentication method used previously.
What it means: the account authenticated against the domain, and SQL Server has no login for it, or the login cannot reach the database.
Resolution. In SQL Server Management Studio, connected to the instance:
<DOMAIN>\<gmsa>$, including the $, and select Windows authentication. A login created without the $ will never match.dbcreator at installation, and db_owner on AMDB afterwards.VIEW SERVER STATE on the server and CONNECT on each monitored database. sysadmin is not required.What it means: the client could not get a ticket for the SQL Server service, so the connection fell back to NTLM or failed outright. This is a Kerberos registration problem that a correct gMSA does not avoid.
MSSQLSvc SPN belongs to the account SQL Server runs as, which is not necessarily the gMSA Applications Manager connects with. Register it on the gMSA only when SQL Server itself runs as that gMSA.Resolution:
setspn -L <domain>\<sql_service_account>
setspn -Q MSSQLSvc/<sql_server_fqdn>:1433
setspn -X
MSSQLSvc/<sql_server_fqdn>
MSSQLSvc/<sql_server_fqdn>:1433
setspn -D MSSQLSvc/<sql_server_fqdn>:1433 <domain>\<wrong_account>
setspn -S MSSQLSvc/<sql_server_fqdn>:1433 <domain>\<sql_service_account>
-S rather than -A: it refuses to create a duplicate, and a duplicate SPN breaks Kerberos for every client of that server.
For the errors that follow from an SPN problem, and for anything that mentions tickets, realms or clock skew, see How do I troubleshoot SQL Server Kerberos configuration issues?
Run this on the SQL Server while Applications Manager is connected. It is the same query the product's own gMSA check uses:
SELECT a.auth_scheme, b.login_name
FROM sys.dm_exec_connections AS a
JOIN sys.dm_exec_sessions AS b ON a.session_id = b.session_id
WHERE b.program_name = 'ApplicationsManager';
login_name must be <DOMAIN>\<gmsa>$ and auth_scheme should read KERBEROS. A different login name means the service is not running as the gMSA; NTLM means the SPN is not being matched (4.4).
The MS SQL Self-Help tool reports the same check as gMSA Account Authentication Result, with the command it ran and its output, which is usually quicker than reproducing the test by hand.
Run every command below as an administrator, and replace the placeholders with your own values. Share the following:
Test-ADServiceAccount <gmsa> on the Applications Manager hostsetspn -L for the SQL Server service account, and of setspn -XStartUpLogs_out.txt, and the SQL Server error log covering the same periodRefer to our feature page to learn more about SQL Server monitoring in Applications Manager.