Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

Last post 11-03-2009 7:37 PM by dotnetruler. 15 replies.

Sort Posts:

  • Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

    06-25-2003, 8:51 AM
    • Member
      10 point Member
    • foo73
    • Member since 05-28-2003, 2:50 PM
    • Posts 2
    I just installed the CSK and chose the option to use Windows authentication. However, now I am getting this error when trying to access the site:

    Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

    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
    System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) +44
    System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +304
    System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
    System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +38
    ASPNET.StarterKit.Communities.CommunityUtility.GetAllCommunitiesFromDB() +93
    ASPNET.StarterKit.Communities.CommunityUtility.GetAllCommunities() +58
    ASPNET.StarterKit.Communities.CommunityUtility.GetCommunityInfo() +326
    ASPNET.StarterKit.Communities.CommunitiesModule.Application_BeginRequest(Object source, EventArgs e) +221
    System.Web.SyncEventExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +60
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87


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

    06-25-2003, 9:07 AM
    • Member
      180 point Member
    • bentomkins
    • Member since 06-09-2003, 6:44 AM
    • Posts 36
    try putting this inside your web.config file inside the <system.web> tag...

    <system.web>

    <identity impersonate="true" userName="xxxxx" password="xxxxx" />

    <.system.web>
  • Re: Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

    06-25-2003, 9:36 AM
    • Member
      10 point Member
    • foo73
    • Member since 05-28-2003, 2:50 PM
    • Posts 2
    I added this using a local account and it worked beautifully. Thanks for your help.
  • Re: Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

    11-13-2003, 2:44 PM
    • Member
      20 point Member
    • saxroots
    • Member since 07-22-2003, 12:57 PM
    • Posts 4
    Thank you so much - I had the same problem and your solution worked perfectly - thanks!
  • Re: Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

    08-16-2007, 9:38 PM
    • Member
      2 point Member
    • geoDenver
    • Member since 08-17-2007, 1:34 AM
    • Posts 1

    Just an addendum. If you exclude the usernName="" and password="", it uses the authenticated user's permissions. That way you can customize permissions based on the Windows users or groups and you're not stuck with only one account.

     Thanks so much for your post, it helped solve a very nagging problem.

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

    09-10-2007, 4:56 PM
    • Member
      2 point Member
    • user2008
    • Member since 09-10-2007, 6:31 PM
    • Posts 6

    Hi,  One doubt with this!  If the configuration is hardcoded with username and password of one user, how will other users be able to authenticate through those credentials?? 

    Thanks,

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

    12-08-2007, 2:46 AM

    hi all,

    when i run my application on local pc or local host it runs fine but when i put it on server and try running from IP of server "Login failed for user 'NT AUTHORITY\NETWORK SERVICE'" error come,

    i made changes as suggested above in <System.web> now the error changes to "Login failed for user 'SERVERNAME\IUSR_WEB-SERVER'".

    can any one help....i have been using same web.config with same code in other project too...but without error.

    please tell me the possible source of error.

    thanks

    --------------------------------------------------------

    Mark as answered if this or any other post helps in finding solution to ur query, it will help others later....
  • Re: Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

    02-28-2008, 11:58 AM
    • Member
      44 point Member
    • shwaqar
    • Member since 08-23-2006, 2:07 PM
    • Posts 13

    Hi

    I have the same issue. I tried using the above code in web.config. Nothing happens. Any help please......?

     

    Regards

    Shaukat

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

    02-29-2008, 4:44 AM

    Hi Shaukat,

    Hope u hv checked ur IIS setting and is fine.

    Next see the database u r using has 'sa' dbo Login Name which is created at the time of database creation.

    This will be under databasename>users.

     Regards.

    --------------------------------------------------------

    Mark as answered if this or any other post helps in finding solution to ur query, it will help others later....
  • Re: Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

    12-04-2008, 1:23 AM
    • Member
      6 point Member
    • rmsohaila
    • Member since 11-22-2007, 9:58 AM
    • Lahore
    • Posts 35

    Thanks a lot it works.

    R. M. Sohail Arshed
    ASP.net Developer
    Teamone.Solution
  • Re: Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

    06-16-2009, 12:41 PM
    • Member
      6 point Member
    • madanmohan2k6
    • Member since 06-16-2009, 4:32 PM
    • Posts 3
    it worked for me Thanks a lot..
  • Re: Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

    06-16-2009, 1:12 PM
    • Member
      6 point Member
    • madanmohan2k6
    • Member since 06-16-2009, 4:32 PM
    • Posts 3

     It helped me a lot

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

    06-16-2009, 1:22 PM
    • Member
      6 point Member
    • madanmohan2k6
    • Member since 06-16-2009, 4:32 PM
    • Posts 3

     Hi

      for the error "Login failed for user 'SERVERNAME\IUSR_WEB-SERVER'" do following settings to work fine

        Start-->Run-->inetmgr-->right click on your application and select Properties-->  Directory Security -->click edit for "Authentication and access control" ---> uncheck the check at "Enable the anonymus access"--> click ok and apply that's it.

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

    10-07-2009, 3:57 AM
    • Member
      2 point Member
    • vkkreddy
    • Member since 09-24-2009, 6:03 AM
    • Posts 8

     Hi, I have the same Problem. I had a Web Application. It was developed in ASP.NET , C# , VS 2008 and SQL Server 2008. I am using connection string as

    "Data Source=xxxx;Initial Catalog=xxx;Integrated Security=True".

    It is working fine, when I run it from the Visual Studio. When I run it from the Internet Exlporer(After Creating Virtual Directory), I am able to access the Home Page. When I provide the User name and Password in that page and click on Login Button, i.e., at the time when it is hiting the Data Base, I am getting the Same Error. The Error is as Follows

    Server Error in '/SriVariVevaCell' Application.

    Login failed for user 'NT AUTHORITY\IUSR'.

    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\IUSR'.

    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\IUSR'.]
       System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4844759
       System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
       System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
       System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35
       System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +144
       System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +342
       System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221
       System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189
       System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185
       System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +31
       System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +433
       System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
       System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +499
       System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65
       System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
       System.Data.SqlClient.SqlConnection.Open() +122
       System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) +31
       System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +112
       System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +287
       System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +92
       System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1297
       System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +19
       System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142
       System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
       System.Web.UI.WebControls.GridView.DataBind() +4
       System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
       System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +72
       System.Web.UI.Control.EnsureChildControls() +87
       System.Web.UI.Control.PreRenderRecursiveInternal() +44
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053  

     

     I think the Problem was in Connection String. I using the SQL Server Windows Authentication. Please Help me ASAP.

    Thanks in advance.

    kiran

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

    10-07-2009, 2:20 PM
    • Member
      7 point Member
    • MasterV23
    • Member since 09-23-2009, 12:56 PM
    • Posts 33

    Check your SQL DB and make sure under your DB instance > Security > Logins > Right Click > Properties of that USER.  Then under server roles, make sure that "sysadmin" is check.

    Next try your website again and see if it fixes the problem.

Page 1 of 2 (16 items) 1 2 Next >