2010-07-21 44 views
10

我有一個IIS 7機器,在單個默認網站 上有多個apps/vdirs。我想設置他們兩個這樣的認證: 匿名 - 關 模擬 - 在 窗體身份驗證 - 關 Windows驗證 - 在使用AppCmd設置特定的IIS 7站點?

我想與Appcmd.exe的做到這一點,但似乎無法得到 語法向右。有沒有人有這個運氣?

謝謝。

回答

18

您應該嘗試配置編輯器(包含在IIS 7.5中,可用於下載IIS 7.0的http://www.iis.net/download/AdministrationPack),它可以自動生成AppCmd.exe命令以及javascript和託管代碼。使用它,我產生了以下(默認網站):

appcmd.exe set config "Default Web Site" -section:system.webServer/security/authentication/anonymousAuthentication /enabled:"False" 

appcmd.exe set config "Default Web Site" -section:system.web/identity /impersonate:"True" 

appcmd.exe set config "Default Web Site" -section:system.webServer/security/authentication/windowsAuthentication /enabled:"True" /commit:apphost 

注意,與那些承諾:APPHOST是因爲部分在默認情況下,這意味着它們需要使用位置路徑內對ApplicationHost.config設置鎖定。

+0

完美的答案。謝謝!我不知道這是在行政部門。 – Snowy 2010-07-28 18:34:58