Login failed for user 'NT AUTHORITY\NETWORK SERVICE

Last post 12-16-2009 2:03 PM by gogginl. 13 replies.

Sort Posts:

  • Login failed for user 'NT AUTHORITY\NETWORK SERVICE

    05-02-2003, 2:12 AM
    • Member
      15 point Member
    • Greg1
    • Member since 05-02-2003, 1:26 AM
    • Posts 3

    Hello mates,

    I get an error when I view http://localhost/StoreVBVS/Default.aspx. I did have one error during the initial setup which was, "[Fail] Could not add ASPNET user to SQL Server.
    Windows NT user or group 'ASPNET' not found. Check the name again." Do I manually create the user and do I create it in SQL Enterprise Manager or do I create it in Active Directory Users and Computers? I don't know but this may/probably has to to with the error I get when I open http://localhost/StoreVBVS/Default.aspx. The error is as follows and before we get to it I want to thank anyone who is kind enough to respond to my plea in advance, you are a great person =) And now to the error:

    Server Error in '/StoreVBVS' Application.
    --------------------------------------------------------------------------------

    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:


    Line 63:
    Line 64: ' Execute the command
    Line 65: myConnection.Open()
    Line 66: Dim result As SqlDataReader = myCommand.ExecuteReader(CommandBehavior.CloseConnection)
    Line 67:


    Source File: C:\StoreVBVS\StoreVBVS\Components\ProductsDB.vb Line: 65

    Stack Trace:


    [SqlException: Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.]
    System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +472
    System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372
    System.Data.SqlClient.SqlConnection.Open() +384
    IBuySpy.IBuySpy.ProductsDB.GetProductCategories() in C:\StoreVBVS\StoreVBVS\Components\ProductsDB.vb:65
    IBuySpy.C_Menu.Page_Load(Object sender, EventArgs e) in C:\StoreVBVS\StoreVBVS\_Menu.ascx.vb:44
    System.Web.UI.Control.OnLoad(EventArgs e) +67
    System.Web.UI.Control.LoadRecursive() +35
    System.Web.UI.Control.LoadRecursive() +98
    System.Web.UI.Control.LoadRecursive() +98
    System.Web.UI.Page.ProcessRequestMain() +731


  • Re: Login failed for user 'NT AUTHORITY\NETWORK SERVICE

    05-02-2003, 9:36 AM
    • Participant
      1,860 point Participant
    • DavidGMiles
    • Member since 06-18-2002, 4:24 AM
    • United Kingdom
    • Posts 372
    it is a change in the way that ASP.NET works, add NETWORK SERVICE as a SQL login and assign it the same database access as the ASPNET user.

    DavidM
    Various IBS Addons available at http://www.snowcovered.com

    Lead Developer [vb & c#] - MCAD
  • Re: Login failed for user 'NT AUTHORITY\NETWORK SERVICE

    05-02-2003, 3:54 PM
    • Member
      15 point Member
    • Greg1
    • Member since 05-02-2003, 1:26 AM
    • Posts 3
    David,

    I want to first thank you for your time and responce. I have just a few things I want to check with you. About the ASPNET user, should it be created in the Security part of SQL Enterprise Manager or should it be a windows account? I created NETWORK SERVICE under the Security part of Enterprise Manager and gave it owner access to every database. Should I use SQL Server Authentication for both ASPNET and NETWORK SERVICE accounts and should they have blank passwords?

    Thank you again,

    GregF
  • Re: Login failed for user 'NT AUTHORITY\NETWORK SERVICE

    05-05-2003, 10:04 AM
    • Member
      10 point Member
    • jaimea
    • Member since 10-21-2002, 9:58 AM
    • Posts 2
    Greg1,

    Did you get your connection working?

    I have the same problem. Did you create the ASPNET acct and NETWORK SERVICE acct.?
    How did you create them?

    Thank you,

    Jaime
  • Re: Login failed for user 'NT AUTHORITY\NETWORK SERVICE

    05-06-2003, 1:49 PM
    • Member
      15 point Member
    • luisvelasco
    • Member since 08-15-2002, 9:34 AM
    • Tucson
    • Posts 3
    I have the same problem, in my computer, there is an ASPNET user (that the .net framework installed) but there is no NT AUTHORITY\NETWORK SERVICE user. I wonder how is that user created.

    Thanks

    Luis
  • Re: Login failed for user 'NT AUTHORITY\NETWORK SERVICE

    05-07-2003, 4:20 PM
    • Member
      15 point Member
    • Greg1
    • Member since 05-02-2003, 1:26 AM
    • Posts 3
    I got it working! Thank you DavidM! I followed DavidM's advice and in SQL Enterprise Manager I added a user 'NT AUTHORITY\NETWORK SERVICE" and gave it all the access I could. And it worked. It wont work unless you have "NT AUTHORITY\" before "NETWORK SERVICE".

    Good Luck,
    Greg1
  • Re: Login failed for user 'NT AUTHORITY\NETWORK SERVICE

    05-07-2003, 4:38 PM
    • Member
      5 point Member
    • MazQuest
    • Member since 05-07-2003, 4:34 PM
    • Posts 1
    This helped me:

    Supporting integrated authentication with SQL Server
    http://www.asp.net/faq/AspNetAndIIS6.aspx#4
  • Re: Login failed for user 'NT AUTHORITY\NETWORK SERVICE

    05-07-2003, 6:11 PM
    • Participant
      1,860 point Participant
    • DavidGMiles
    • Member since 06-18-2002, 4:24 AM
    • United Kingdom
    • Posts 372
    sorry for not getting back to you - busy busy busy - but glad to see you got it working

    DavidM
    Various IBS Addons available at http://www.snowcovered.com

    Lead Developer [vb & c#] - MCAD
  • Re: Login failed for user 'NT AUTHORITY\NETWORK SERVICE

    05-08-2003, 5:31 PM
    • Member
      60 point Member
    • davidvairin2
    • Member since 02-05-2003, 6:58 PM
    • Posts 12
    I tried adding this but it can't find the domain NT AUTHORITY. How did you add this user to your computer?
  • Re: Login failed for user 'NT AUTHORITY\NETWORK SERVICE

    05-14-2003, 5:51 PM
    • Member
      5 point Member
    • MikeFaulkner
    • Member since 05-13-2003, 11:10 AM
    • Posts 1
    Just type it in with the backslash in front of the user ID as in: "'NT AUTHORITY\NETWORK SERVICE"

    And you DON'T need to give it ALL rights EVERYWHERE! (You'll open up the same security hole that existed before, by an outsider assuming you HAVE such a user named that and it's "all powerful" in the SQL server!)

    Just give it ownership of any databases your WEB Server apps create/use.

    Mike
  • Re: Login failed for user 'NT AUTHORITY\NETWORK SERVICE

    05-17-2003, 6:23 PM
    • Member
      5 point Member
    • appschannel
    • Member since 12-13-2002, 4:51 PM
    • Posts 1
    I was getting the same problem. I resolved it by adding User IIS_WPG and granting it all rights and permissions to the Community Starter Kit Database. I got there by using the SQL Server Enterprise Manager and going to the Security/logins for the server. You can then do a new Login and use the ... on the name to list all of the users and roles available on the server. I then did a trial and error by adding a few accounts that might be associated with process and finally by setting the IIS_WPG rights, it began to get by this error.
  • Re: Login failed for user 'NT AUTHORITY\NETWORK SERVICE

    10-10-2003, 1:31 PM
    • Member
      5 point Member
    • kspaenje
    • Member since 10-10-2003, 9:10 AM
    • Posts 1
    The solution is actually quite simple.
    Go to the Internet Information Server Manager (IIS), open the DefaultAppPool Properties and choose Local System as the Predefined Security Account for the servers web apps.

    greets
  • Re: Login failed for user 'NT AUTHORITY\NETWORK SERVICE

    09-18-2009, 2:43 PM
    • Member
      54 point Member
    • ansdhr
    • Member since 09-10-2008, 8:25 PM
    • Posts 111

    kspaenje's solution helped me.I changed the defaultAppPool identity to Local System. It worked.

  • Re: Login failed for user 'NT AUTHORITY\NETWORK SERVICE

    12-16-2009, 2:03 PM
    • Member
      64 point Member
    • gogginl
    • Member since 06-29-2006, 1:49 PM
    • Posts 148

    Yes, Changing the Predefined account name from "Network Service"  to "Local System" under the Identity TAB

    works.

Page 1 of 1 (14 items)