网站集之前的新托管路径

时间:2012-04-04 18:15:09

标签: sharepoint powershell collections path managed

我已经创建了顶级Web应用程序和网站集。 我的网站集的powershell输入是。

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

在此之后,我尝试在URL上创建一个新的顶级站点。

  

使用powershell命令“http://teams.contoso.com/Finance”

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?

1 个答案:

答案 0 :(得分:0)

就像您通过中央管理员一样,您不会指定网站集,而是指定managed path将在其下生效的网络应用程序:

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