【发布时间】:2011-07-01 07:42:15
【问题描述】:
我正在编写一个 VBscript,我想更改我的 Web 服务器上特定站点的匿名身份验证配置。但是,我不确定这是如何在提交路径中完成的。目前,我可以在全球范围内更改设置,但我只想针对一个特定的站点文件夹。我最好的猜测是在 MACHINE/WEBROOT/APPHOST 的末尾简单地包含站点路径。
'CHANGE ANONYMOUS AUTHENTICATION GLOBALLY (working code):
Set adminManager = CreateObject("Microsoft.ApplicationHost.WritableAdminManager")
Set anonymousAuthenticationSection = adminManager.GetAdminSection("system.webServer/security/authentication/anonymousAuthentication", "MACHINE/WEBROOT/APPHOST")
anonymousAuthenticationSection.Properties.Item("enabled").Value = True
anonymousAuthenticationSection.Properties.Item("userName").Value = "myUser"
anonymousAuthenticationSection.Properties.Item("password").Value = "myPass"
adminManager.CommitChanges()
'MY BEST GUESS AT TARGETING A SPECIFIC SITE (returns error 80070005):
Set anonymousAuthenticationSection = adminManager.GetAdminSection("system.webServer/security/authentication/anonymousAuthentication", "MACHINE/WEBROOT/APPHOST/Sites/InsideFTL/Corp/redirects/netXposure")
【问题讨论】:
标签: authentication iis-7 vbscript