Create a managed path in SharePoint 2013/2016 using PowerShell

This PowerShell SharePoint tutorial explains, how to create and remove managed path using PowerShell for a web application in SharePoint 2013/2016.

If you are new to Managed path in SharePoint, check out my article on managed path in SharePoint 2013/2016 as well as how we can create a managed path using browser from central administration.

Create managed path SharePoint 2013 PowerShell

We can also create managed path using SharePoint 2013 management Shell (PowerShell) in SharePoint 2013.

For Explicit inclusion

For explicit inclusion managed path, below is the PowerShell command, we we need to add -explicit parameter.

Add-PSSnapin "Microsoft.SharePoint.PowerShell"
New-SPManagedPath "/Technology" -WebApplication "http://mynewwebapp:42885/" -explicit
create managed path sharepoint 2013 powershell
create managed path sharepoint 2013 powershell

Now if you will create a site collection, then in the URL you will be able to see the path created like below:

create managed path sharepoint 2016 powershell
create managed path sharepoint 2016 powershell

For Wildcard inclusion:

If you will not mention the -explicit parameter then it will become Wildcard inclusion. The command will be looks like below:

Add-PSSnapin "Microsoft.SharePoint.PowerShell"
New-SPManagedPath "/Finance" -WebApplication "http://mynewwebapp:42885/"
how to create managed path in sharepoint 2013 using powershell
how to create managed path in sharepoint 2013 using powershell

Once you will run it will display like below:

how to create managed path in sharepoint 2016 using powershell
how to create managed path in sharepoint 2016 using powershell

After this when you will create the site collection, it will display like below:

Remove managed path using PowerShell in SharePoint

We can use the below PowerShell command to remove managed path in SharePoint 2013/2016.

Add-PSSnapin "Microsoft.SharePoint.PowerShell"
Remove-SPManagedPath -Identity "/Finance" -WebApplication "http://mynewwebapp:42885/"

It will ask a confirmation message and once you click on Yes, it will remove.

remove managed path sharepoint 2013 powershell
remove managed path sharepoint 2013 powershell

You may like following SharePoint tutorials:

Hope this SharePoint tutorial explains, how to create managed path in SharePoint 2013 using PowerShell and also we discussed how to delete managed path in SharePoint 2013/2016 using PowerShell.

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.

Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SPGuides.com

>