3

How can I test a connection via machine name as the SQL logon name (ie mydomain\server01$ - as an IIS AppPool would connect) using sqlcmd?

I'm having trouble figuring out an application's SQL Server connection issue.

marc_s
9,0626 gold badges46 silver badges52 bronze badges
asked May 31, 2016 at 19:13

2 Answers 2

1

You would generally not find an Application pool using the computer account to connect to SQL Server. At most I would not want to allow that type of configuration.

You should be able to accomplish it by running the process as the local system account, NT AUTHORITY\SYSTEM. You can do this by using psexec. You would just specify -s parameter to execute it as the system account.

I think something like this should work:

psexec -s "sqlcmd -S myserver -E"
joanolo
13.7k8 gold badges39 silver badges67 bronze badges
answered Jun 1, 2016 at 7:29
1

The computer account is only used if the app pool is using a local account and is trying to connect to a remote SQL server. Typically you would not want to add the machine account to the SQL server as that would permit any location account on that server to have access to the SQL server. The best way is to use a domain account as the app pool account.

But if you absolutely have to have it that way then you will need to log in as an account that is on the local IIS box and then attempt to connect to the remote SQL server.

joanolo
13.7k8 gold badges39 silver badges67 bronze badges
answered Jul 2, 2017 at 20:00

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.