Share via


SharePoint 2016 Administration: Configure Managed Paths Using PowerShell

Managed Paths in SharePoint are used to specify the paths in the URL namespace of Web Applications to be shared by the Site Collections hosting by the Web Application.

We have got two kinds of Managed Paths that can be created with in SharePoint namely Wildcard and Explicit.

Explicit Managed Paths

Explicit Managed Paths may be used when we are not planning to create Site Collections under a specific Managed Path. We will see the creation of the Explicit Managed Path in this article and it would be like

http://sp-2016-dev/prashant-explicit

In this case we cannot have more one site collection pointing to this URL.

Wildcard Managed Paths

Wildcard Managed Paths may be used when we are planning to create Sites or Sub Sites under a specific Managed Path. We will see the creation of the Wildcard Managed Path in this article and it would be like

http://sp-2016-dev/prashant-wildcard/

In this case we can have more one site collection pointing to the managed path specified by this URL

In this article we will be walking through the steps and PowerShell Scripts involved in creating Managed Paths in SharePoint 2016

  • Launch Central Administration Site
  • Choose “Manage Web Applications”

https://howtodowithsharepoint.files.wordpress.com/2016/03/119.png?w=800

  • Select the Web Application in context of which you want to create the Managed Paths
  • Choose “Manage Paths” Ribbon Control

https://howtodowithsharepoint.files.wordpress.com/2016/03/29.png?w=800

We can see the UI for “Define Managed Paths” screen in the Modal Dialog and this is the place where we can add required managed paths for our Web Application.

https://howtodowithsharepoint.files.wordpress.com/2016/03/37.png?w=800

But since this article is about automating the SharePoint Processes so we will see how to do it using PowerShell in the following sections-

PowerShell Command

Wildcard Managed Paths

  • Launch SharePoint 2016 Management Shell
  • Run the following PowerShell Command to add a Wildcard Managed Path
New-SPManagedPath "Prashant-Wildcard" -WebApplication http://sp-2016-dev

https://howtodowithsharepoint.files.wordpress.com/2016/03/47.png?w=800

We can go back to “Define Managed Path” screen to verify if the new Managed Path has been added for the specific Web Application

https://howtodowithsharepoint.files.wordpress.com/2016/03/57.png?w=800

Explicit Managed Paths

  • Launch SharePoint 2016 Management Shell
  • Run the following PowerShell Command to add a Wildcard Managed Path
New-SPManagedPath "Prashant-Explicit" -WebApplication "http://sp-2016-dev" –Explicit

https://howtodowithsharepoint.files.wordpress.com/2016/03/67.png?w=800

We can go back to “Define Managed Path” screen to verify if the new Managed Path has been added for the specific Web Application

https://howtodowithsharepoint.files.wordpress.com/2016/03/77.png?w=800

Now finally we can verify the availability of the new created Managed Paths to the Site Collections created under the roof of Web Application http://sp-2016-dev

  • Go to Application Management
  • Choose “Create Site Collections”

https://howtodowithsharepoint.files.wordpress.com/2016/03/85.png?w=800

On the “Create Site Collection” screen under “Web Site Address” section we can see the newly created Managed Paths both Wildcard and Explicit type

https://howtodowithsharepoint.files.wordpress.com/2016/03/94.png?w=800

That is all for this demo.

Hope you find it helpful.