Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / General / September 2004

Tip: Looking for answers? Try searching our database.

NT AUTHORITY\NETWORK SERVICE

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stanley J, Mroczek - 28 Sep 2004 22:07 GMT
My disk was replaced and i reload all my software. I think that i named my
computer best-si-01 instead of BEST-SI-01 and thats my error?

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

I have all my software on one system. .net and sql.

the system work fine before i had reload it.
Dan Kelley - 29 Sep 2004 08:59 GMT
I am assuming this is an asp.net app as you mention web requests. I would be
surprised if the machine name is incorrect. It is more likely the security on
your IIS virtual directory is not configured in the same way as it was
before. If you are using anonymous access, try changing the user account to
an account that will definately have DB access.

> My disk was replaced and i reload all my software. I think that i named my
> computer best-si-01 instead of BEST-SI-01 and thats my error?
[quoted text clipped - 10 lines]
>
> the system work fine before i had reload it.
Stanley J Mroczek - 29 Sep 2004 23:13 GMT
i am using server=localhost;Trusted_Connection=true;
What else do i have to do?
stan

> I am assuming this is an asp.net app as you mention web requests. I would be
> surprised if the machine name is incorrect. It is more likely the security on
[quoted text clipped - 16 lines]
> >
> > the system work fine before i had reload it.
Michael Earls - 30 Sep 2004 17:54 GMT
> i am using server=localhost;Trusted_Connection=true;
> What else do i have to do?
[quoted text clipped - 20 lines]
>>>
>>>the system work fine before i had reload it.

Stan,

The solution to this problem depends on a few things.

Is your web application using Windows Security, or does it use Web Forms
or anonymous access?  If you're trying to pass along the credentials
from the end user to the database (to limit database activity based on
known users), you'll need to make sure you've got impersonation enabled
in the Web.config (search MSDN and you'll find out how to do this).

If you're just using a single login to manage all database calls, then
you'll need to configure SQL Server to allow the NETWORK SERVICE user
access.

If the database and web server are on the same box, then just ensure
that the NT AUTHORITY\NETWORK SERVICE user has been granted permissions
on the database that you are accessing.

In SQL Enterprise manager, navigate to the database that you're trying
to access.  Look under Security and add a new login.  Choose Windows and
then select the "NT AUTHORITY\NETWORK SERVICE" user from the list (if
it's not there, you should be able to type it in).

Within the database, grant this user permissions to use the database (I
strongly suggest that you choose individual permissions rather than make
this user a "dbo" (database owner).

You have two other options.  If the SQL Server and the Web server are on
separate machines (assuming they are in the same Windows domain), you
can change the user that IIS uses to execute your web application.
You'll do that from Internet Services manager.  Tinker with the settings
and see if you can figure it out.  If not, I'll tell you.

Once you change the user that IIS runs your application as, you'll need
to add this user to SQL server and grant the appropriate permissions.

There is another way...

If you have configured SQL server to allow "mixed mode" security, then
you can create a SQL login for your database and change the connection
string to use SQL security rather than Trusted.  You then add your new
user credentials to the connection string ("uid=username;pwd=password;").

This is WAAY more information than you needed, but the answer is in
there somewhere. ;)

Michael Earls

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.