Remove an Alternate Access Mapping

Scenario/Problem: You need to remove an existing alternate access mapping entry.

Solution: Use the Remove-SPAlternateURL cmdlet.

The Remove-SPAlternateURL cmdlet enables you to remove the specified alternate URL entry. The only required parameter is the Identity of the URL mapping, as shown in Listing 5.11.

Listing 5.11. Remove an Existing Alternate Access Mapping

Remove-SPAlternateURL -Identity "http://intranet.sp2013.com"

The -Identity parameter can be the incoming URL or a variable identifying the alternate access mapping (using the Get-SPAlternateURL cmdlet).

Note

If the alternate access mapping entry is public and the zone is Default, you may not remove the alternate URL entry.

Get PowerShell™ for SharePoint® 2013 How-To now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.