Create a managed path in SharePoint 2013/2016 using PowerShell
Check out Best Alternative to InfoPath -> Try Now
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
Now if you will create a site collection, then in the URL you will be able to see the path created like below:
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/"
Once you will run it will display like below:
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.
You may like following SharePoint tutorials:
- Extending Web Applications in SharePoint 2013
- Delete Hidden Web Application in SharePoint 2013 using PowerShell
- How to retrieve all content database names for SharePoint 2016 web applications using the SharePoint server object model?
- Check Anonymous access for all web applications in SharePoint
- Retrieve all web application names from SharePoint farm using the server object model in SharePoint 2016
- Get content database sizes for all web applications in a SharePoint farm using PowerShell
- Comparing a Web Application and Site Collection limits in SharePoint 2016 with SharePoint 2013 2010 2007
- SharePoint 2016 Create a web application and a Site collection using PowerShell
- Get all Sites and subsites under web application using PowerShell in SharePoint 2013
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.
Download SharePoint Online Tutorial PDF FREE!
Get update on Webinars, video tutorials, training courses etc.