0
我正在使用下面的PowerShell腳本在IIS6服務器上設置匿名用戶身份和身份驗證方法。該腳本似乎首先起作用,但如果在運行後發出iisreset,則值將恢復爲舊的!我如何堅持他們?Powershell:在IIS6中設置匿名用戶
$server = "localhost"
$siteName = "www.mysite.com"
$iis = [ADSI]"IIS://$server/W3SVC"
$site = $iis.children | where { $_.keyType -eq "IIsWebServer" -and $_.ServerComment -eq $siteName }
$path = [ADSI]($site.path+"/ROOT")
$path.AnonymousUserName = "user"
$path.AnonymousUserPass = "pass"
$path.AuthFlags = 3
$path.CommitChanges()