2012-04-04 50 views
0

我已經創建了頂級Web應用程序和網站集。 我的網站集的PowerShell輸入是。網站集之前的新託管路徑

Get-SPWebTemplate | Where{ $_.Title -eq "Team Site" } | ForEach-Object{ New-SPSite http://teampowershell.sharepoint1c.lab -OwnerAlias SHAREPOINT1C\SP_FARM -Template $_ } 

之後,我嘗試在URL上創建一個新的頂級網站。

「http://teams.contoso.com/Finance」 用PowerShell命令

Get-SPWebTemplate | Where{ $_.Title -eq "Team Site" } | ForEach-Object{ New-SPSite http://teampowershell.sharepoint1c.lab/finance -OwnerAlias SHAREPOINT1C\SP_FARM -Template $_ } 

但我有此錯誤招呼

>"New-SPSite : A site collection could not be created as the provided managed pat 
h does not exist. Change the URL to use an existing managed path or create the 
missing managed path prior to calling this command. 
At line:1 char:83 
+ Get-SPWebTemplate | Where{ $_.Title -eq "Team Site" } | ForEach-Object{ New-S 
PSite <<<< http://teampowershell.sharepoint1c.lab/finance -OwnerAlias SHAREPOI 
NT1C\SP_FARM -Template $_ } 
    + CategoryInfo   : InvalidData: (Microsoft.Share...SPCmdletNewSite: 
    SPCmdletNewSite) [New-SPSite], SPCmdletException 
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletNewSite" 

我想我有創建一個託管路徑,但我在哪裏指定託管的SiteCollectionURL?

回答

0

就像你將通過中央管理,你不指定網站集而是Web應用程序在其下managed path將生活:

New-SPManagedPath [-RelativeURL] "</RelativeURL>" -WebApplication <WebApplication>