Create managed path in SharePoint 2013 using PowerShell Script

Hello Everyone,

In this article, I'll show you how to create managed path. If you created site collection through UI you already seen, there is only one option available under Web Site Address option for create you Site Collection under web application as you know we can create number of Site Collection under same web application so for make some difference in their URL's then you have to create you own managed path via UI functionality that is available in Central Admin under web application page or you can directly create new managed path through PowerShell command for done this via PowerShell see following steps:

Steps:

See UI option for create Site Collection under your chosen web application and see blue circled option:

All you have to create new managed path after creation new option will be in this dropdown.

  1. Open Manage Web Application --> select your web application --> select Managed Paths option
  2. Following dialog will be shown:                 
  3. See two managed path created here one is Explicit and another is wildcard
  4. Write Learn in the Path textbox and type will be WildCard inclusion and Add Path and Ok

It’s all done now you will got Learn option in the dropdown list.

 

Do this with PowerShell command:

help New-SPManagedPath

help New-SPManagedPath –examples

PS C:\Users\ajazta> help New-SPManagedPath -examples

NAME

    New-SPManagedPath

SYNOPSIS

    Applies to:

    Creates a new managed path for the given Web application for all host header site collections.

    ------------------EXAMPLE-----------------------

    C:\PS>New-SPManagedPath "Teams" -WebApplication "http://somesite"

   This example creates a Teams managed path for a given Web application (http://somesite).

Steps:

1: PS C:\Users\ajazta> New-SPManagedPath "learn" -WebApplication "http://dsknomoe12:5566/"

Name                           Type

----                           ----

learn                          WildcardInclusion

2:

 

3: Done-->

 

Now create new site collection under the WebApplication: (Fresher Site)

$template = Get-SPWebTemplate "STS#0"

New-SPSite -Url "http://dsknomoe12:5566/learn/sharepoint" -OwnerAlias "myPC\myUsername" -Template $template

Created Successfully……..

Add comment