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.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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 TorresCertified Database AdministratorCommented:
Which version of IIS?
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:


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?
Jose TorresCertified Database AdministratorCommented:
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
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"
    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:

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.