Link to home
Start Free TrialLog in
Avatar of Tom McDonald
Tom McDonaldFlag for United States of America

asked on

System.Data.SqlClient.SqlException: Login failed for user 'domain\user'.

I am using trusted connections and I have configured IIS 7 to use connect as a specific active directory user.  However, when it connects it doesn't use the user I set up for it (see attached image).  It connects with the machine name!  The error I get is:

 System.Data.SqlClient.SqlException: Login failed for user 'AD\MYComputer$'.

In the error 'AD\MyComputer' is the name of my development laptop. Why isn't it connecting as the user I specified?  How do I fix it?
   User generated image
Avatar of ingriT
ingriT
Flag of Netherlands image

Is the "connect as" used for SQL or is it only your web server settings?
Do you have (another) connectionstring in a web.config file or something?
Avatar of Tray896
The connect as that your image shows is only to connect to a directory, not to a database that is part of your application.  The error indicates an issue trying to connect to SQL.  Try modifying your application pool to run as this domain user by clicking on Application Pools, select the catsmerge app pool, and then click on advanced settings.  From there you can modify the identity so that it runs under the domain account.
ASKER CERTIFIED SOLUTION
Avatar of guru_sami
guru_sami
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Tom McDonald

ASKER

You're right, I didn't realize it, but I had the web.config identity impersonate set to true.  I set it to false and then the correct identity was passed