Re: Trusted SQL Connections & NT AUTHORITY\NETWORK SERVICE
- From: "Joe Kaplan" <joseph.e.kaplan@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 1 Mar 2007 00:29:33 -0600
Are you sure the web app is trying to hit SQL on the network? The network
service account is supposed to use the credentials of the machine account
when it accesses the network to use a remote resource. What you are seeing
at work is what I'd expect and what you are seeing at home is a bit strange
to me. Any other environmental differences?
Joe K.
--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
"Craig Wagner" <MSDNNospam207@xxxxxxxxxxxxx> wrote in message
news:1A271C50-46EF-4440-B417-D9C3944F469C@xxxxxxxxxxxxxxxx
I'm trying to better understand the role of the NT AUTHORITY\NETWORK
SERVICE
and how it works with respect to SQL Server connections.
First some background and then the question.
I have a very simple test web page that does the following:
using( SqlConnection dbConnection = new SqlConnection( "Data
Source=server;Initial Catalog=db;Integrated Security=True" ) )
{
dbConnection.Open();
DataSet ds = new DataSet();
DbDataAdapter adapter = new SqlDataAdapter( "select statement",
dbConnection );
adapter.Fill(ds);
gridView.DataSource = ds;
gridView.DataBind();
}
I put this web app on two different Windows 2003 servers, one that is in
my
domain at work and one that is in my domain at home. In each environment
the
connection information points to a database that is local to that
environment
(i.e. I'm not trying to hit a database in my home domain from work or vice
versa), but on a different machine than the web server. In both cases the
web
app is in an application pool where the Identity tab indicates it should
used
the Predefined Network Service account.
At the top of the page I display the values from
Environment.UserDomainName
and Environment.UserName. In both environments this information displays
as
NT AUTHORITY and NETWORK SERVICE respectively.
So here's the thing I can't figure out...
At work, the web app tries to connect to the database as
domain\machinename$. At home the web app tries to connect to the database
as
NT AUTHORITY\NETWORK SERVICE.
What's up with that? Any pointers as to where to look for more
information?
.
- Next by Date: Re: ActiveDirectoryMembershipProvider & ValidateUser
- Next by thread: Re: Trusted SQL Connections & NT AUTHORITY\NETWORK SERVICE
- Index(es):
Relevant Pages
|