Login failed for user 'NT AUTHORITY\NETWORK SERVICE'

Posted on 2005-05-11
Last Modified: 2008-01-09
I am trying to set up my intranet to use some aspx pages. I am able to view the aspx pages from any browser on the intranet but when I try to access any dynamic data it errors out with:

Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
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 'NT AUTHORITY\NETWORK SERVICE'.

Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace:
[SqlException (0x80131904): Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.]
   System.Data.ProviderBase.DbConnectionPool.GetConnection(Object owningObject) +317
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnectionBase owningConnection) +90

I have set the authentication to sql and windows(mixed mode)
I added the IUSR account that the IIS server is using to access the webpage to the database users.
Windows 2003 server, intranet IIS and sql are running on the same server, ASP.NET 2.0..


Question by:uyht
    LVL 14

    Expert Comment

    what's the connection string you're currently using (xxx out any passwords)?
    LVL 2

    Author Comment

    connectionString="Server=zion;Integrated Security=True;Database=ePO_ZION;Persist Security Info=True" providerName="System.Data.SqlClient"

    I think that is the connection string but there are no passwords...I am using the visual web developer program to write the aspx code. I took this line from the web.config file for the site
    LVL 14

    Accepted Solution

    you've said that your sql and IIS are on the same server,
    try changing these:
    Integrated Security=SSPI

    Your website according to the configuration you've set above for iusr_machinename account should be setup to use Anonymous Access.
    If the users are instead coming through using Integrated or Basic you'll need to setup these userids as valid SQL users with access to the ePO_ZION database.
    let me know if it sorts it out.
    LVL 14

    Expert Comment

    thanks for the points!

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    What is an ISAPI filter?   •      It's an assembly (.dll file) that can add or change the way IIS works.   •      They can be enabled globally for your web server or on a site-by-site basis.   When the IIS server receives a request, enabling the ISAPI fi…
    Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
    This video discusses moving either the default database or any database to a new volume.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now