Sql server 身份验证:AppPool已设置为网络服务用户,但DB正在获取域\机器$user?

Sql server 身份验证:AppPool已设置为网络服务用户,但DB正在获取域\机器$user?,sql-server,asp.net-mvc-2,iis-7,iis-6,Sql Server,Asp.net Mvc 2,Iis 7,Iis 6,这是令人烦恼的,在它周围搜索会产生很多无用的结果(返回有关网络服务未验证的问题-哦,有那个特殊问题!) 我已将ASP.NET MVC 2应用程序部署到IIS6和7 Web服务器,并将应用程序池设置为作为网络服务进行身份验证。但是,我得到了SQL错误: 用户“域\服务器名称$”登录失败 那么为什么它使用这个用户而不是网络服务呢?为了吓唬它,我试图为用户添加一个新的登录名,但显然,它不起作用 My web.config如果您需要它进行设置 <?xml version="1.0"?> &l

这是令人烦恼的,在它周围搜索会产生很多无用的结果(返回有关网络服务未验证的问题-哦,有那个特殊问题!)

我已将ASP.NET MVC 2应用程序部署到IIS6和7 Web服务器,并将应用程序池设置为作为网络服务进行身份验证。但是,我得到了SQL错误:

用户“域\服务器名称$”登录失败

那么为什么它使用这个用户而不是网络服务呢?为了吓唬它,我试图为用户添加一个新的登录名,但显然,它不起作用

My web.config如果您需要它进行设置

<?xml version="1.0"?>
<configuration>
  <connectionStrings>
      <add name="ApplicationServices"
            connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=<redacted>CrewChangeover.mdf;Integrated Security=True;User Instance=True"
            providerName="System.Data.SqlClient" />

      <add name="<redacted>.CrewChangeoverConnectionString"
 connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=<redacted>CrewChangeover.mdf;Integrated Security=True;User Instance=True"
 providerName="System.Data.SqlClient" />
      <add name="<redacted>_HR_FullConnectionString"
 connectionString="Data Source=<redacted>\SQLEXPRESS;Initial Catalog=<redacted>;Integrated Security=True"
 providerName="System.Data.SqlClient" />

  </connectionStrings>

  <system.web>
    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </assemblies>
    </compilation>

    <authentication mode="Forms">
      <forms loginUrl="~/Account/LogOn" timeout="2880" />
    </authentication>

    <membership>
      <providers>
        <clear/>
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices"
             enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
             maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
             applicationName="/" />
      </providers>
    </membership>

    <profile>
      <providers>
        <clear/>
        <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" />
      </providers>
    </profile>

    <roleManager enabled="true">
      <providers>
        <clear/>
        <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
        <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
      </providers>
    </roleManager>

    <pages>
      <namespaces>
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
      </namespaces>
    </pages>
  </system.web>

  <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

网络服务就是那个用户

网络服务在尝试连接到机箱外资源时模拟计算机帐户。不过,向DOMAIN\Servername$授予权限通常是可行的

因此,大致分类如下:

  • 本地服务-低权限,以NULL形式连接到外部资源
  • 网络服务-低特权,以域\计算机的形式连接到外部资源$
  • LocalSystem-高权限,作为域\计算机连接到外部资源$
如果希望应用程序池作为特定Windows用户进行身份验证:

  • 不要使用模拟(看起来你不是)
  • 以特定Windows用户的身份运行应用程序池

罗伯特应该是你母亲的兄弟。

谢谢特里斯坦。似乎发生的事情是,您的回答清楚地表明它是如何“突然”停止工作的,是如何使用另一个(傻瓜!)的sol-config部署到一个位置的。这突出了用户的差异。非常感谢,教育。