In this post we will discuss how we can create and remove managed path using PowerShell for a web application. In my previous article we have discussed about managed path as well as how we can create a managed path using browser from central administration.
We can also create managed path using SharePoint 2013 management Shell (PowerShell) in SharePoint 2013.
You may read:
– CAML Query Designer in Sharepoint 2013 Online
– Change landing home page in SharePoint
– Add datepicker in SharePoint 2013 using client object model
For Explicit inclusion:
For explicit inclusion below is the PowerShell command, we we need to add -explicit parameter.
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:
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:
We can use the below PowerShell command to remove managed path
Remove-SPManagedPath -Identity “/Finance” -WebApplication “http://mynewwebapp:42885/”
It will ask a confirmation message and once you click on Yes, it will remove.
Hope this will be helpful.
Download FREE SharePoint 2019 Installation PDF Guide
This FREE PDF contains, Steps by step guide to install SharePoint 2019 Preview, prerequisites, hardware and software new features. First impression to SharePoint Server 2019 new modern site, modern lists and modern document libraries.