0
A
回答
-1
注:我沒有寫這個博客,但它似乎回答這樣的問題:
<# This function will set the home directory of an IIS 6 website using Powershell 2 (it will not work with v1).
You need to pass it the site description (from the Web Site tab in IIS), the new path and the server your website is running on (this can be a machine name or an IP address).
You wouldn’t believe how long it took me to get this working.
Found on: http://eliasbland.wordpress.com/2010/08/03/change-the-home-directory-of-an-iis-6-website-using-powershell-2-and-wmi/
Usage: SetHomeDirectory "mysite.co.uk" "d:\websites\mysite" "myServer"
#>
Function SetHomeDirectory($SiteDescription, $NewPath, $serverName) {
$query = "ServerComment = '" + $SiteDescription + "'"
$webserver = Get-WMIObject -class IIsWebServerSetting -namespace "root\microsoftiisv2" -Filter $query -computer $serverName -authentication 6
$nameQuery = "Name = '" + $webserver.Name + "/root'"
$webdir = Get-WMIObject -class IIsWebVirtualDirSetting -namespace "root\microsoftiisv2" -Filter $nameQuery -computer $serverName -authentication 6
$webdir.Path = $NewPath
Set-WmiInstance -InputObject $webdir
}
編輯:以鏈接複製整個腳本按照註釋
相關問題
- 1. 阿爾特通過T-SQL的所有觸發器
- 2. 阿爾特列表
- 3. 阿爾特性質
- 4. 阿爾特爲varchar
- 5. 如何通過阿爾卡特Touch使用Adb?
- 6. 阿爾特行爲通過詳細標誌
- 7. Mysql的阿爾特毛刺
- 8. 阿爾特價值ExtJS的
- 9. 通過powershell更新IIS 6 WebSite憑證
- 10. 通過PowerShell獲取IIS日誌位置?
- 11. cakePHP分頁和通過阿爾卑斯
- 12. 英特爾XDK - 通過pushMobi
- 13. 阿爾特file.show()行爲
- 14. 阿爾特情況下sentivity
- 15. 阿爾特列默認值
- 16. 阿爾特數值格式
- 17. 阿爾特使用jQuery
- 18. 阿爾特圖像動能
- 19. ExtJS的:阿爾特商店的pageSize
- 20. 通過PowerShell的
- 21. 通過PowerShell的
- 22. 通過PowerShell的
- 23. 通過PowerShell的
- 24. 通過PowerShell的
- 25. WebBrowser控件 - 阿爾特的JavaScript
- 26. 的Win32阿爾特菜單在代碼
- 27. 阿爾特阿賈克斯的Json查詢參數
- 28. 通過IIS
- 29. 通過powershell在iis中的IP地址和域名限制
- 30. 計算阿爾法和電源中心性通過的igraph