How can I find out the name of the "IIS Service Account

I am working with a .NET MVC application.

How can I find out the name of the "IIS Service Account"? (I am getting the error message below, and I have no idea how to find out the name of the "IIS Service Account".)


Cannot make connection to database. Please verify your web.config connections are set correctly. Also make sure you have a Database User created with the same name as the IIS Service Account.
LVL 2
brgdotnetcontractorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jose TorresSenior SQL Server DBACommented:
Which version of IIS?
0
Dan McFaddenSystems EngineerCommented:
Or you can add a user account to the database connection string in your web.config.

Chances are you are using the default configuration for the AppPool that is running your web site.

Reference link for connection strings:  https://msdn.microsoft.com/en-us/library/jj653752(v=vs.110).aspx#sqlserver

Dan
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
brgdotnetcontractorAuthor Commented:
When I look in the about dialog box it says "Windows 7 Enterprise". This is on a Windows 7 maching, my local machine. I run the web page on the localhost.

All I am after is the name of the "IIS Service Account"? How can I find that?
0
Jose TorresSenior SQL Server DBACommented:
Are you connecting to database?
If you are connecting to the database are you connecting to the db with windows authentication or a sql login?
Your web config needs to be set up accordingly to access the db
You can't specify the AD account in the web config the connection setting to the db must be integrated
If you don't use integrated you need to use a sql login with the ID and password
If you change the application pool from application pool identity to a AD account make sure the account you use has access to the db
0
Dan McFaddenSystems EngineerCommented:
You most certainly can place a username and password in a web.config.  From the reference link I posted above:

<add name="ConnectionStringName"
    providerName="System.Data.SqlClient"
    connectionString="Data Source=ServerName;Initial Catalog=DatabaseName;Integrated Security=False;User Id=userid;Password=password;MultipleActiveResultSets=True" />

Open in new window


As an example.

As for determining the IIS Service Account.  Make sure IIS is running locally, make sure both the AppPool and website are running.  Open Task Manager and look for a process(es) named w3wp.exe.  In the column next to the image name, will be a column called User Name, the info listed there will display the account name the process is running as.

Reference link:  http://www.iis.net/learn/manage/configuring-security/application-pool-identities

Dan
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft IIS Web Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.