IIS 7.5:以编程方式将“应用程序池用户”设置为匿名用户

问题描述 投票:0回答:4

我在 IIS 7.5 中有一个 Web 应用程序,它有自己的 AppPool 使用 .net 4.

我想使用具有匿名访问权限的功能作为应用程序池身份 - 这可以通过 inetmgr 管理单元在 GUI 中轻松配置。

有没有办法以编程方式执行此操作,例如通过 web.config?

我环顾四周,看来 anonymousAuthentication 元素可以解决问题,但它没有解释如何以任何重要方式指定应用程序池用户。我已经尝试将我的匿名用户设置为“IIS APPPOOL/[AppPoolName]”,这似乎是here的建议,但没有成功。

对如何配置有什么建议吗?

web-config iis-7.5
4个回答
5
投票

仔细查看该链接:http://www.iis.net/ConfigReference/system.webServer/security/authentication/anonymousAuthentication

'如果将此值留空(即username=""),匿名认证使用应用程序池标识对匿名用户进行认证'


3
投票

对于懒惰的人(我)

<system.webServer>
     <security>
         <authentication>
             <anonymousAuthentication userName="" />
         </authentication>
     </security> 
 </system.webServer>


0
投票

您可以像这样通过 Ansible 以编程方式执行此操作:

- name: Set 'Anonymous Authentication' to 'Application pool identity'
  community.windows.win_xml:
    path: C:\Windows\System32\inetsrv\Config\applicationHost.config
    xpath: //configuration/system.webServer/security/authentication/anonymousAuthentication
    attribute: userName
    fragment: ''
    type: attribute

-1
投票

Muluken 匿名池来检查我的追随者的任何类型的问题。所以如果你参与得好,请尝试给出答案

© www.soinside.com 2019 - 2024. All rights reserved.