Sunday, July 10, 2016

Add Alternate Access Mapping in SharePoint using PowerShell

Alternate Access Mappings helps to expose a SharePoint web application into 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 "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 whats entered in the browser and its 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 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 "http://intranet.crescent.com" -URL "http://portal.crescent.com" –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 IIS site.
powershell set alternate access mapping
You can now access the existing SharePoint web application "http://intranet.crescent.com" using the new URL "http://portal.crescent.com".


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 "http://intranet.crescent.com" –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 "http://intranet.crescent.com" | 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 "http://intranet.crescent.com" –Zone "Internet" 

Tags: powershell add alternate access mapping, add alternate access mapping sharepoint 2010 powershell, create alternate access mapping sharepoint 2010 powershell, sharepoint 2013 alternate access mapping powershell, powershell set alternate access mapping, sharepoint powershell add alternate access mapping



You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Check out these SharePoint products:

No comments :

Post a Comment

Please Login and comment to get your questions answered!


You might also like:

Related Posts Plugin for WordPress, Blogger...