SQL Server login Failed for "Domain\MachineHostname$" error espacially when C# Application running through Windows Service.

  • Thread starter Thread starter K Santhosh
  • Start date Start date
K

K Santhosh

Guest
We are getting error as "Login failed for user 'Domain\MachineHostname$'" when C# application running through Windows Service.

We have the application on one machine and SQL was installed on another machine(Remote Database)

Connection String:
Data Source=<IP Addr>\<SQL Instance>;Initial Catalog=<DBName>;Integrated Security=True;Pooling=True;MultipleActiveResultSets=True;Connect Timeout=90;Load Balance Timeout=3;ConnectRetryCount=3

Same connection string is working fine when i have used in C# Console Application. But when it was used in C# Windows Service using LocalSytem account We are facing the error as "Login failed for user 'Domain\MachineHostname$'".

As we googled and resolved the issue by adding the server login for 'Domain\MachineHostname$' in SQL Server and provided the 'db_owner' for the DB for the particular login.

When application and SQL were in same machine we couldn't find any issue. When it comes to Remote DB we are facing the issue. Why application didnt used the Windows Authentication user name for SQL Server login when we used remotely and why application take 'Domain\MachineHostname$' when services running through LocalSystem account

Continue reading...
 
Back
Top