Add Alternate Access Mapping in SharePoint using PowerShell

Alternate Access Mappings helps to expose a SharePoint web application to different URLs in scenarios such as publishing, load balancing, reverse proxy, etc. Each web application can have up to five different URLs through alternate access mapping, with the “Default” zone as mandatory and other optional zones.

How to Configure Alternate Access Mapping in SharePoint Central Administration?

Follow these steps to set alternate access mapping in SharePoint:

  • Go to the SharePoint 2016 Central Administration Site, Click on System Settings from Left navigation menu.
  • From the “System setting” page, click on “Configure Alternate Access Mappings” link under in the “Farm Management” group.
  • You will be presented with the Alternate Access Mappings page. Select your desired web application to get the AAM settings for the specific web application.
powershell add alternate access mapping

Here, The public URL is the address of the Web Application, where the traffic will be routed to. Internal URLs are what’s entered in the browser, and it’s either transformed/mapped into the Public URL.

To add an alternate access mapping, with the target web application selected, click on “Edit Public URL’s” link >> Enter the appropriate URL for the respective zone and hit Save to commit your changes.

sharepoint 2013 alternate access mapping powershell

You can also use PowerShell to manage Alternate Access Mappings in SharePoint.

Add alternate access mapping SharePoint using PowerShell:

To add an entry to SharePoint alternate access mapping using PowerShell, use cmdlet: New-SPAlternateURL. Here is an example:

New-SPAlternateURL -WebApplication "" -URL "" -Zone Internet

Add a binding to the web application in IIS:

But wait, You are not yet done. This is a common miss in SharePoint. Although you add AAM entry, You must also add IIS binding for the web application for initial redirect to the IIS site.

powershell set alternate access mapping

You can now access the existing SharePoint web application “” using the new URL “”.

PowerShell to remove alternate access mapping:

To remove an existing AAM entry, use the PowerShell cmdlet: Remove-SPAlternateURL. Here is an example:

Get-SPAlternateURL -WebApplication "" -Zone "Internet" | Remove-SPAlternateURL

Get SharePoint alternate access mappings using PowerShell:

To read all alternate access mappings for a given web application, use this PowerShell script.

Get-SPAlternateURL -WebApplication "" | Format-table -AutoSize
 sharepoint powershell add alternate access mapping

Similarly, to get the AAM settings for a specific zone, say Internet, use:

Get-SPAlternateURL -WebApplication "" -Zone "Internet" 

Salaudeen Rajack

Salaudeen Rajack - SharePoint Expert with Two decades of SharePoint Experience. Love to Share my knowledge and experience with the SharePoint community, through real-time articles!

Leave a Reply

Your email address will not be published. Required fields are marked *