亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

站點配置代碼

01 ? ?$appSitePath =?"iis:\sites\Default Web Site\MyWebSite" ? ?

02 ? ?$existWeb = Test-Path $appSitePath ? ?

03 ? ?? ? ?

04 ? ?if($existWeb -eq $false) { ? ?

05 ? ?????$folderPath = $folderPath =?"d:\WebApp\MyWeb" ? ?

06 ? ?????$appPoolName =?"My AppPool" ? ?

07 ? ?? ? ?

08 ? ?????New-Item $appSitePath -physicalpath $folderPath -type Application ? ?

09 ? ?? ? ?

10 ? ?????#設定剛剛建立的application pool ? ?

11 ? ?????Set-ItemProperty $appSitePath -name applicationpool -value $appPoolName ? ?

12 ? ?????? ? ?

13 ? ?????$appSiteShortName = $appSitePath.ToLower().Replace("iis:\sites\", "").Replace("\", "/") ? ?

14 ? ?? ? ?

15 ? ?????#開啟window authentication ? ?

16 ? ?????Set-WebConfigurationProperty -filter /system.webServer/security/authentication/windowsAuthentication -name enabled -value?true?-PSPath IIS:\ -location $appSiteShortName ? ?

17 ? ?? ? ?

18 ? ?????#關閉anonymous authentication ? ?

19 ? ?????Set-WebConfigurationProperty -filter /system.webServer/security/authentication/anonymousAuthentication -name enabled -value?false?-PSPath IIS:\ -location $appSiteShortName ? ?

20 ? ?? ? ?

21 ? ?????#移除預設的首頁並重新設定 ? ?

22 ? ?????Remove-WebConfigurationproperty -filter /system.webserver/defaultdocument -name files -PSPath IIS:\ -location $appSiteShortName ? ?

23 ? ?????Add-WebConfiguration -filter /system.webserver/defaultdocument/files -atIndex 0 -value @{value =?"default.aspx"} -PSPath IIS:\ -location $appSiteShortName ? ?

24 ? ?} ? ?


正在回答

0 回答

舉報

0/150
提交
取消

站點配置代碼

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號