2012-06-12 41 views
0

我正在使用WIX工具構建安裝程序包。我需要根據用戶需求爲IIS中的特定虛擬目錄啓用/禁用表單身份驗證。我曾嘗試APPCMD命令,但不能得到它的工作:如何在IIS中啓用/禁用表單身份驗證

appcmd set config "Default Web Site/Test" /commit:WEBROOT /section:system.web/authentication /mode:Forms /commit:apphost

請建議...

回答

0

這裏是爲我工作的代碼..

啓用Forms身份驗證:

appcmd set config "Default Web Site/Test" /section:system.web/authentication /mode:Forms 

禁用Forms身份驗證:

appcmd set config "Default Web Site/Test" /section:system.web/authentication /mode:Windows 

剛剛刪除/commit:WEBROOT得到它的工作。

如果我加入/commit:WEBROOT上面的代碼將只爲「默認Web站點」,而不是「默認Web站點/測試」