The word “domain” sends everyone to the domain admins, and most of the time the domain is fine. The client offered Windows credentials that SQL Server could not validate, and in a corporate environment that is usually an account that is locked out or a password that changed, with a machine that is not on the domain a close second. The checks below take about 2 minutes each and run in the order that finds it.
The Usual Causes
In rough order of how often they turn out to be the answer:
The account is locked out, or its password changed while a session, saved connection, scheduled task or service kept presenting the old one. In a corporate environment this is the cause I see most: the user is locked out or typed a bad password, and the message makes it sound like a domain fault.
One account or one machine fails while every other client connects normally. The service desk or AD team sees the account locked or the password recently changed, and unlocking it or signing out and back in on the failing machine clears it.
A laptop, a jump box, or a container trying Integrated authentication with a local Windows account. A local account means nothing to the server’s domain, and this is the exact message it earns.
whoami on the failing client comes back with a machine name where a domain name should be, hpai01\peter rather than DOMAIN\peter. Nothing on the server side will fix that.
Kerberos needs a name to find a service principal, so an IP connection falls back to NTLM, and where NTLM is blocked by policy the attempt surfaces as this error rather than something clearer. A DNS alias does the same thing more quietly: sqlprod.contoso.com pointing at SQL01 asks Kerberos for an SPN under the alias name, nobody registered one, and the fallback fails the same way.
That session negotiated NTLM and never KERBEROS, and either the address it connected to has no name in it, or the same client works by the server’s real hostname and fails by the alias. Check 3 below is where you read the scheme.
Kerberos never worked because the service account never registered its SPNs, and nobody noticed because Windows authentication quietly fell back to NTLM for years. Then a security baseline or hardening change sets the Restrict NTLM policies to Deny, and every remote Windows login fails from the same moment while local connections carry on. Nothing changed on the SQL Server, which is why it is the last place anyone looks.
Many clients fail at once, the auth_scheme query shows NTLM and no KERBEROS rows, and the error log from the last startup says the SPN could not be registered (Check 4). The fix is the SPNs, not the policy: register them against the account that runs the service, then reconnect by name.
Possible, and worth checking last unless several machines started failing together. The companion error in that family is the SSPI handshake failure (17806).
Checks 1 to 3 come back clean on more than 1 client, the SPNs are registered, and they all started failing at the same moment. Until that is true, it is one of the 4 above.
Microsoft’s reference covers error 18452 in full, and it also lists 2 SQL-login causes: an instance set to Windows authentication only, and a SQL login that does not exist. On any supported version those 2 come back as 18456 (states 58 and 5 in the error log), not 18452. If you are using SQL authentication, you want Login Failed (18456).
What To Check, In Order
Each of these is a 2-minute check, and they are ordered so the common causes go first:
1. Is the account locked out, or did its password change? Ask the user, then ask whoever holds the directory. A lockout or a changed password with something on that client still presenting the old one is the answer more often than everything else on this page, and it only needs an unlock or a sign out and back in.
2. Is the failing client using a domain account? whoami on the client answers it. A MACHINE\user result instead of DOMAIN\user is the whole diagnosis. If it is a domain account and only this machine fails, klist purge clears a stale Kerberos ticket, nltest /sc_query:DOMAIN confirms the machine’s own trust with the domain, and on a VPN nslookup DOMAIN has to return domain controllers, because a client that cannot find one cannot get a ticket.
3. Is the connection by name or by IP? Check the connection string. If it is an IP, test the same connection with the server’s DNS name before touching anything else, and read what the working sessions negotiate on the server:
-- Windows connections that ARE working: which scheme did they negotiate?
SELECT auth_scheme, COUNT(*) AS connections
FROM sys.dm_exec_connections
GROUP BY auth_scheme;
A server showing only NTLM where you expect KERBEROS is a standing clue that names and SPNs, not passwords, are where this error comes from. Kerberos vs NTLM covers what to do with that result.
4. Did it fail for one client or many at once? One = that client’s account, token or configuration. Many at the same moment = server-side or domain-side, and now the domain conversation is justified. Before you make that call, read what the server logged about its SPNs at startup:
-- SPN registration at the last startup
EXEC xp_readerrorlog 0, 1, N'could not register';
A row that says SQL Server could not register the Service Principal Name (SPN), and that this might cause integrated authentication to use NTLM instead of Kerberos, means Kerberos has never worked here. With NTLM now refused, that is the NTLM card above, and the SPNs are the fix.
The Fixes
Match the fix to the cause you found:
- Locked out or changed password: get the account unlocked or the password reset, then sign the account out and back in on the failing client, and restart any service or scheduled task still running with the old password.
- Not on the domain: use a domain account. Where the machine cannot be domain-joined, runas /netonly presents domain credentials across the network only, which sidesteps the local-account problem. SQL authentication is the other way out, stated as a decision rather than a fix. For an application in a domain the server will never trust, a contained database user with a password keeps that decision inside one database.
- Connecting by IP or an alias: connect by the server’s DNS name instead, or register an SPN for the alias name against the service account.
- NTLM blocked and no SPN: register the SPNs and reconnect by name. Relaxing the NTLM policy puts the old fallback back, it does not fix it.
- Many clients at once: go to the domain team with evidence, which client, which account, name or IP, one machine or many. Microsoft’s page suggests
setspnandrunasto test the trust outside your application.
What You Can Fix as the DBA
As DBAs we are not normally Domain Admins, so when the cause is the account, a lockout or a password that changed, the fix sits with the service desk or the AD team: unlock it, reset it, and have the user sign out and back in. What you own is the evidence that gets that ticket actioned quickly: which account, which client, name or IP, one machine or many, and what the auth_scheme query shows for the sessions that do work.
In my career I have been a Domain Admin several times at other companies, and the smaller the company the more likely the DBA holds rights well beyond the database. If that is you, the unlock is yours to do, and the evidence above is still worth a line in the ticket. Even sysadmin on the instance is heading the same way: read-only roles day to day, with write rights activated against a change order when you need them, so a fix here is often a ticket before it is a command.
When It Is Not This
If the message names a specific reason, a disabled account (18470) or an expired password (18487, 18488), you are in a more specific branch of the login-failure family. If the connection dies before authentication starts, with TLS or handshake wording, that is the pre-login handshake error rather than anything about trust.
Frequently Asked Questions
Do I need the domain admins?
Why does connecting by IP matter?
Can I just switch to SQL authentication?
I am using SQL Server authentication. Can I get 18452?
Integrated Security=True or Trusted_Connection=True in it, the user id and password are ignored and Windows authentication runs as whatever account the process runs under. Remove the flag. Otherwise start at Login Failed (18456).Will ticking Trust Server Certificate fix it?
It only fails from a Java application.
integratedSecurity=true makes the driver present the identity of the process, and on a host that is not domain-joined that is not a domain account, so SSMS on a domain desktop connects while the application on the off-domain host gets 18452. On Linux the default native authentication is not available at all, so the failure comes from the driver or Kerberos before SQL Server sees a login. Use Kerberos with authenticationScheme=JavaKerberos, or a SQL login.Where To Go Next
Which neighbour you need depends on what the checks above found:
- Cannot Connect to SQL Server: The Checks in the Order That Finds It, the router for every connection error. Start here when you are not sure which one you have.
- Login Failed or Permission Denied, the router for the other Windows authentication failures.
- Kerberos vs NTLM, why IP connections and missing SPNs change how you authenticate.
- SSPI Handshake Failed (17806), the server half of the same failure.
- Login Failed (18456), when the message gives no reason at all.
- Login Disabled (18470), when the login exists but is switched off.
- Open SSMS as a Different Domain User, runas /netonly for a machine that is not on the domain.
- Check Connection Encryption and Protocol, what your sessions actually negotiate.
Leave a Reply