1
votes

I tried to run the same commands as in here -https://technet.microsoft.com/en-us/library/cc263165(v=office.14).aspx .

 $template = Get-SPWebTemplate "STS#0"
New-SPSite -Url "http://web-application-name/sitecollection1" -OwnerAlias "domain\administrator" -Template $template

I am getting the following 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.

What does this error mean? What am i missing?

1
Before creating a Sitecollection you have create a managed Path. Syntax: New-SPManagedPath –RelativeURL "<Name>" -WebApplication "share point2010/" - Vasanthan
Thank you for your reply, but it didn't work. I am still getting the same error after running: New-SPManagedPath -RelativeURL "sitecollection1" -WebApplic ation "web-application-name". Maybe i am giving the wrong URI in New-SPSite command? - Natalie Polishuk
The web-application-name should include the protocol and host. Ensure that the (root) is set up to Wildcard Inclusion and not Explicit Inclusion. - vapcguy

1 Answers

1
votes

1.$template = Get-SPWebTemplate "STS#0"

if you are getting error upon running this command use this link https://support.microsoft.com/en-us/help/2796733/sharepoint-2010-management-shell-does-not-load-with-windows-powershell-3.0 to fix it

2.Create a managed path

New-SPManagedPath -RelativeURL "sitecollection1" -WebApplic ation "web-application-name"

3.Create the site collection

New-SPSite -URL "http://web-application-name/sites/sitecollection1"-OwnerAlias "domain\administrator" -Template $template

It is not very clear for my how to create a site collection with a path like: http://web-application-name/sitecollection2 But this solution worked for what i needed.