sql web-application Connection String for member of a domain group [closed]

Posted on

Question :

In my testing environment, I have a local sql express (2008R) server instance. I’ve created a domain group and given it a login in the database.

But now, how do I consctruct the connection string for my web-application? Do I give it the username and password of one of the members of the group?

And, what do I put for a “user” in the Database security section? The group itself doesn’t have a password.

Do I have to add the service account from the application pool to the AD group?

Here is what I have for a connection string; but this allows all connections, it seems:

<add name="development" connectionString="server=myserversqlexpress;
    database=mydatabase;Persist Security Info=True;Integrated Security=SSPI;
    Trusted_Connection=True; Pooling=True" providerName="System.Data.SqlClient"

Answer :

You need to configure the IIS Application Pool to use the identity (domain user) you created.

My example below shows the default, out-of-the-box configuration. You’d need to choose ‘Configurable’ and specify the username and password there.

Then you need to configure the site to use the AppPool.

enter image description here

The connection string would then be:

server=myserversqlexpress;database=mydatabase;Persist Security Info=True;
Integrated Security=SSPI;Trusted_Connection=True; Pooling=True

Just like you have it.

Leave a Reply

Your email address will not be published.