none
hOW TO CREATE WINDOWS AUTHENTICATION USER IN SQL SERVER AFTER INSTALLING SQL SERVER 2008

    Question

  • I had an error while executing asp.net appcation from IIS as follows

    Login failed for user 'IIS APPPOOL\ASP.NET v4.0'.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'IIS APPPOOL\ASP.NET v4.0'.

    [SqlException (0x80131904): Login failed for user 'IIS APPPOOL\ASP.NET v4.0'.]

    Can the above problem be solved by CREATING WINDOWS AUTHENTICATION LOGIN FOR 'IIS APPPOOL\ASP.NET v4.0'  ?

    If yes, how to create the login?

    If no,what is the best possible solution?


    Please reply as soon as possible as i am unable to run my project which I had done in my lab,in my home system.
    • Edited by Praveen_Bhargav Tuesday, September 13, 2011 6:57 PM need for quick reply
    Tuesday, September 13, 2011 6:38 PM

Answers

  • Hi Praveen,

    To fix this issue, you need to change the Identity of your website's Application Pool to use the NetworkService account (or the less secure LocalSystem account).  By default, IIS7 seems to set the Application Pools Identity to 'ApplicationPoolIdentity' instead of NetworkService or LocalSystem.

    Here's a step-by-step guide for determining your websites Application Pool, then changing its Process Model Idenitty in IIS7:

    1.Open Internet Information Services (IIS) Manger.
    2.In the Connections sidebar, drill down into Default Web Site and click on your website.
    3.Now in the Actions sidebar (on right side), click on Advance Settings... In the popup box, under General you will see your Application Pool listed for your website (in my case the app pool is: ASP.NET V4.0).
    4.Click Cancel...  If you choose, you can change the Application Pool here, but for the sake of this example we just wanted to find out what the website's App Pool was.

    Then change the app pool's (Process Model) Identity to 'NetworkService', the steps are showed as below:

    1.Open Internet Information Services (IIS) Manger.
    2.In the Connections sidebar, click on Application Pools.
    3.Now right-click on theApplication Pool that your website is using (in this case my site is using the ASP.NET v4.0 application pool), and select Advanced Settings... from the menu.
    4.In the Advanced Settings pop-up box, locate the Process Model -> Identity section and click on the Application Pool Identity.
    5.In the Application Pool Identity pop-up box, change the Built-in account to NetworkService (or if you want LocalSystem), then click OK, and click OK again to save your Advanced Settings changes.

    Hope this helps.


    Best Regards,
    Peja

    Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Marked as answer by Stephanie Lv Tuesday, September 20, 2011 9:05 AM
    Thursday, September 15, 2011 5:56 AM

All replies

  • Hi,

    Create a login for your server  as follows:

    CREATE LOGIN [IIS APPPOOL\ASP.NET v4.0] FROM WINDOWS;
    

    Then add this user to your database as user and assign the necessary permission.

    I hope it helps.

    J.


    There are 10 type of people. Those who understand binary and those who do not.
    Tuesday, September 13, 2011 7:01 PM
  • Any progress?
    There are 10 type of people. Those who understand binary and those who do not.
    Wednesday, September 14, 2011 7:09 PM
  • Hi Praveen,

    To fix this issue, you need to change the Identity of your website's Application Pool to use the NetworkService account (or the less secure LocalSystem account).  By default, IIS7 seems to set the Application Pools Identity to 'ApplicationPoolIdentity' instead of NetworkService or LocalSystem.

    Here's a step-by-step guide for determining your websites Application Pool, then changing its Process Model Idenitty in IIS7:

    1.Open Internet Information Services (IIS) Manger.
    2.In the Connections sidebar, drill down into Default Web Site and click on your website.
    3.Now in the Actions sidebar (on right side), click on Advance Settings... In the popup box, under General you will see your Application Pool listed for your website (in my case the app pool is: ASP.NET V4.0).
    4.Click Cancel...  If you choose, you can change the Application Pool here, but for the sake of this example we just wanted to find out what the website's App Pool was.

    Then change the app pool's (Process Model) Identity to 'NetworkService', the steps are showed as below:

    1.Open Internet Information Services (IIS) Manger.
    2.In the Connections sidebar, click on Application Pools.
    3.Now right-click on theApplication Pool that your website is using (in this case my site is using the ASP.NET v4.0 application pool), and select Advanced Settings... from the menu.
    4.In the Advanced Settings pop-up box, locate the Process Model -> Identity section and click on the Application Pool Identity.
    5.In the Application Pool Identity pop-up box, change the Built-in account to NetworkService (or if you want LocalSystem), then click OK, and click OK again to save your Advanced Settings changes.

    Hope this helps.


    Best Regards,
    Peja

    Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Marked as answer by Stephanie Lv Tuesday, September 20, 2011 9:05 AM
    Thursday, September 15, 2011 5:56 AM
  • Hello, thx for your help. From all answers from net , yours was the most helpful and simple.
    Sunday, December 02, 2012 5:09 AM
  • I have faced same issue, involved me error "Login failed for user IIS apppool default apppool" then I start look into IIS application, I check "Identity" under process model and change in account to "Local system" then it works fine me, you may check following link to resolve error Login failed for user IIS apppool default apppool

    thanks!
    Saturday, December 21, 2013 6:32 PM