Home All Groups Group Topic Archive Search About

System.Data.SqlClient.SqlException: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'

Author
23 Feb 2007 7:55 PM
Nick nkw
I already following the steps in:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskaccessingsqlserverusingwindowsintegratedsecurity.asp

But I still get the error. I found it works when using VS.Net internal
web server. It use Domain\MachineName$ to connect SQL Server after
publish to IIS. (It works on IIS after I remove <identity
impersonate="true"/>)

Author
23 Feb 2007 8:23 PM
Peter Bromberg [C# MVP]
What this is telling you is that the Anonymous Logon identity doesn't have
permissions to the specified database. Obviously, as you stated, you can
either change the identity to one that does, or give this account permssions.
Or, you can use SQL Server authentication, which is often a lot easier.
Peter

Show quote
"Nick nkw" wrote:

> I already following the steps in:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskaccessingsqlserverusingwindowsintegratedsecurity.asp
>
> But I still get the error. I found it works when using VS.Net internal
> web server. It use Domain\MachineName$ to connect SQL Server after
> publish to IIS. (It works on IIS after I remove <identity
> impersonate="true"/>)
>
Author
23 Feb 2007 8:35 PM
bruce barker
you will notice, that if you connect to your dev box from another
machine it won't work with <identity impersonate="true"/> and if you hit
the site locally on the web server it will work (just like using your
dev box).

to use impersonation you need to switch to kerberos (and enable forwarding).

-- bruce (sqlwork.com)


Nick nkw wrote:
Show quote
> I already following the steps in:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskaccessingsqlserverusingwindowsintegratedsecurity.asp
>
>
> But I still get the error. I found it works when using VS.Net internal
> web server. It use Domain\MachineName$ to connect SQL Server after
> publish to IIS. (It works on IIS after I remove <identity
> impersonate="true"/>)
Author
24 Feb 2007 6:33 PM
msdn
my develop box is also connect to the SQL server remotely. And sp_who shows
my Windows domain users. Sounds internal web server and IIS handle SQL
Server logon differently.

Show quote
"bruce barker" <nospam@nospam.com> wrote in message
news:O7bdlp4VHHA.192@TK2MSFTNGP04.phx.gbl...
> you will notice, that if you connect to your dev box from another machine
> it won't work with <identity impersonate="true"/> and if you hit the site
> locally on the web server it will work (just like using your dev box).
>
> to use impersonation you need to switch to kerberos (and enable
> forwarding).
>
> -- bruce (sqlwork.com)
>
>
> Nick nkw wrote:
>> I already following the steps in:
>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskaccessingsqlserverusingwindowsintegratedsecurity.asp
>> But I still get the error. I found it works when using VS.Net internal
>> web server. It use Domain\MachineName$ to connect SQL Server after
>> publish to IIS. (It works on IIS after I remove <identity
>> impersonate="true"/>)

AddThis Social Bookmark Button