0

I am running a .net app to a SQL Server db (local user app).

I have a specific AD account I would like to connect to the db with (since it has access permissions).

This AD account is not the same as the users AD account.

Normally I would use SQL Server auth to connection explicitly with a particular user but SQL Server auth is not available to me.

Only option I can see is to make the AD user a group, grant the group permissions and add the user to this group. Then use normal Windows integrated security connection strings.

Is it possible to access the SQL Server database using a different specific AD user in the conn string?

Thanks.

This is a different question as i do not want to connect with the current user the app is running as, but as ANOTHER specific AD user. ie. app runs as X.. config is setup for connection to DB as user Y

  • Try this: http://stackoverflow.com/a/14270127/5159431. Unfortunately, this has been asked many times before and I'll be voting to close this as a duplicate. – Ash Jul 25 '16 at 00:16
  • that question is about running under iis app pools. this situation is different. its running as X and connecting as user Y.. both ad users. – jony jo jo Jul 25 '16 at 22:28
  • In that case,you probably need to look at this question: http://stackoverflow.com/questions/1168571/run-code-as-a-different-user-c . You'll need to use impersonation to achieve this. This answer on the page I've linked looks promising: http://stackoverflow.com/a/30466535/5159431. Connecting to SQL while impersonating will allow you to use the other user's creds. – Ash Jul 26 '16 at 00:07
  • This link also looks closer to what you require: http://stackoverflow.com/questions/8439517/connecting-to-a-database-using-windows-authentication-with-different-credentials. All of this assumes you're using C#. – Ash Jul 26 '16 at 00:14

0 Answers0