我試圖創建創建一個新的IIS 6的網站,並設置之類的應用程序池,通配符應用程序映射,ASP.NET版本等如何使用PowerShell
PowerShell腳本來更新現有的IIS 6網站經過在互聯網上的大量搜索後,我發現了一個腳本,允許我創建一個新的網站,但不能修改我需要的所有屬性。
$newWebsiteName = "WebSiteName"
$newWebsiteIpAddress = "192.168.1.100"
$newWebSiteDirPath = "c:\inetpub\wwwroot\WebSiteName"
$iisWebService = Get-WmiObject -namespace "root\MicrosoftIISv2"
-class "IIsWebService"
$bindingClass = [wmiclass]'root\MicrosoftIISv2:ServerBinding'
$bindings = $bindingClass.CreateInstance()
$bindings.IP = $newWebsiteIpAddress
$bindings.Port = "80"
$bindings.Hostname = ""
$result = $iisWebService.CreateNewSite
($newWebsiteName, $bindings, $newWebSiteDirPath)
任何有關如何擴大上述示例的幫助,我們將不勝感激。
對不起,您需要修改哪些屬性? – 2010-02-11 12:02:28