Login failed for user 'serverName\sqlServerInstance$'. Reason: Could not find a login matching the name provided. [CLIENT: <local machine>]

CharlieLor 551 Reputation points
2021-03-05T15:52:15.393+00:00

I found that I kept getting this error from the SQLPS (SQLAgent$instanceName@serverName) application name. How do I modify this SQLPS application so that I no longer receive this login failed error?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,629 questions
{count} votes

9 answers

Sort by: Most helpful
  1. Bill Stewart 181 Reputation points
    2021-03-05T23:41:36.72+00:00

    The error message is telling you exactly what's wrong.

    You are trying to connect to a SQL Server instance, but the account you are trying to use is not defined as a login for that instance.

    1 person found this answer helpful.
    0 comments No comments

  2. Jeffrey Williams 1,886 Reputation points
    2021-03-08T21:00:03.307+00:00

    Is this by chance related to the syspolicy agent jobs? If so - it is a known issue: https://feedback.azure.com/forums/908035-sql-server/suggestions/32897173-syspolicy-purge-history-agent-job-tries-to-access

    1 person found this answer helpful.
    0 comments No comments

  3. CharlieLor 551 Reputation points
    2021-03-08T19:17:32.547+00:00

    The SQL Server agent "Log on as" is setup to use "NT Service\SQLAgent$sqlServerInstance". It's running fine under this account though. However, I kept getting this error in the default SQL Server instance.

    0 comments No comments

  4. Erland Sommarskog 100.8K Reputation points MVP
    2021-03-08T21:58:12.347+00:00

    If I disabled a SQL Server job agent then this login failed log goes away.

    If you disabled SQL Server Agent, that's a good lead. Now you need to look through the jobs that you have. Not the least the ones that fails...

    Jeffery is on to something. Do you get these login failures at two o'clock in the morning? In that case it is quite surely the syspolicy job.

    0 comments No comments

  5. CharlieLor 551 Reputation points
    2021-03-12T16:24:42.463+00:00

    Yes, it failed at 2AM. Since it seems to be a syspolicy job, do I just ignore this error? I'm running SQL Server 2019.