If the rename procedure does not complete
successfully, the server being renamed may no longer function as a
SharePoint server. Running the SharePoint 2013 Products Configuration
Wizard may resolve any issues; however, there is the potential of
configuration database corruption forcing you to rebuild the SharePoint
farm.
Display the Configured Managed Paths
Scenario/Problem: You need to display the current managed paths configured on a web application in the farm.
Solution: Use the Get-SPManagedPath cmdlet with an associated web application.
Issuing the Get-SPManagedPath cmdlet with the WebApplication parameter (as shown in Listing 2) displays all configured managed paths on the SharePoint farm, as shown in Figure 1.
Listing 2. Retrieving Configured Managed Paths
Get-SPManagedPath -WebApplication "SharePoint - 80"
Figure 1. Get-SPManagedPath displays all configured managed paths.
Create a New Managed Path
Scenario/Problem: You want to create a new managed path in a web application on the SharePoint farm.
Solution: Use the New-SPManagedPath cmdlet.
Using the New-SPManagedPath cmdlet enables you to create a new managed path on the specified web application, as shown in Listing 3.
Listing 3. Creating a New Managed Path
New-SPManagedPath -WebApplication "SharePoint - 80"
-RelativeURL "/teamsites/"
The forward slashes (/) in the
name of the managed path are optional but provide a visual queue
(similar to manually creating a managed path through Central
Administration).
By default, the managed path is created as a wildcard inclusion type. You can use the Explicit switch parameter to generate the managed path as an explicit inclusion type, as shown in Listing 4.
Listing 4. Creating a New Managed Path with Explicit Inclusion
New-SPManagedPath -WebApplication "SharePoint - 80" -RelativeURL
"/departments/" -Explicit
Tip
You may also create a managed path using the HostHeader parameter instead of the WebApplication parameter. New-SPManagedPath has two parameter sets for this purpose.