0

I already created a top level Web Application and site collection. The powershell input for my site collection is.

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

After this I am attempting to create a new top level site at the URL.

"http://teams.contoso.com/Finance" with the powershell command

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

but I am greeted with this error

>"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"

I assume I have to create a managed path but where do I specify a managed SiteCollectionURL?

4

1 回答 1

0

Just like you would through Central Admin, you don't specify the site collection but rather the the web app under which the managed path will live:

New-SPManagedPath [-RelativeURL] "</RelativeURL>" -WebApplication <WebApplication>
于 2012-04-04T18:23:37.973 回答