Login failure for domain\Machine$

Chris Stamey 1 Reputation point
2020-10-09T15:37:16.61+00:00

I am dealing with the infamous "Login failed for user 'domain\machinename$'. Reason: Could not find a login matching the name provided. [CLIENT: <local machine>]"

After searching the internet I have tried adding "NT AUTHORITY\NETWORK SERVICE" with db_DataReader in Master and MSDB, then promoting it to SysAdmin when the former didn't stop the error messages.
I tried the above first, after reading that trying Domain\MachineName$ was a red herring.
After none of that worked, I tried adding the Domain\MachineName$ with the same rights, then SysAdmin on the server.
None of the above has worked. I don't know what to try next.
I need to know what I to do here, and if it is adding a user to SQL Server, I need to know what rights it needs to be granted, in one or more DBs, and/or what server roles is must be granted. Also, is a service restart necessary for the solution to take affect?
This is on SQL Server 2014, on an Azure VM running Win 2012.

Thanks,
Chris

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,711 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. David Browne - msft 3,766 Reputation points
    2020-10-09T15:47:22.937+00:00

    "Login failed for user 'domain\machinename$'.

    If the login is originating from a service on the same server as the SQL Server you can see this error message when the actual login is from a virtual account. For instance if a local SSAS instance is connecting with the default service account, you need to grant access to

    NT Service\MSSQLServerOLAPService
    

    even though the login failure displays the machine account. These virtual service accounts will use the machine account when connecting to remote servers, but not for local resources.

    0 comments No comments

  2. Chris Stamey 1 Reputation point
    2020-10-09T16:24:45.367+00:00

    Through Profiler, I have learned that this is being caused by Microsoft SQL Server Iaas Agent Query Service.

    Thanks,
    Chris

    0 comments No comments

  3. Cris Zhan-MSFT 6,601 Reputation points
    2020-10-12T01:59:53.567+00:00

    Hi @Chris Stamey ,

    Grant permissions to the account used for the Microsoft SQL Server IaaS Agent and IaaS Query Service.
    sql-troubles.blogspot.com/2018/10/sql-server-troubleshooting-login-failed.html


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  4. Chris Stamey 1 Reputation point
    2021-04-06T13:17:37.1+00:00

    Sorry, I got onto other issues and forgot about this one.

    Through some more experimenting I found what no one spells out anywhere in the documentation:
    Add NT SERVICE\SQLIaaSExtensionQuery to the SQL Server with SysAdmin rights.
    Add NT Service\SQLIaaSExtension to the SQL Server with SysAdmin rights.

    Chris

    0 comments No comments