开发者

SQL Server SMO on IIS with Windows Auth

开发者 https://www.devze.com 2023-02-07 15:05 出处:网络
I\'m getting a strange error when I enable windows authentication on IIS and try to run some database update scripts:

I'm getting a strange error when I enable windows authentication on IIS and try to run some database update scripts:

Invalid token for impersonation - it cannot be duplicated.

开发者_运维知识库

I have not enabled any explicit impersonation.

I have narrowed it down to being something to do with SMO as when I change to a normal SqlClient and use ExecuteNonQuery, the problem goes away. This unfortunately is not a long term solution as the update scripts must be able to contain the 'GO' keyword which is not recognized by the standard SqlClient.


IIS worker processes are running as some user. When you use windows authentication, you are implicitly doing impersonation to the that user.

If your SQL server is on a different host, this probably isn't good enough. The impersonated user I think can only access local resources.

http://msdn.microsoft.com/en-us/library/ff647405.aspx#paght000025_usingimpersonation

Is SQL Server using windows authentication?

0

精彩评论

暂无评论...
验证码 换一张
取 消