Scenario/Problem: You need to create a new alternate access mapping for a web application.
Solution: Use the New-SPAlternateURL
cmdlet.
You can programmatically generate alternate access mappings using the New-SPAlternateURL
cmdlet. The main parameter set requires the URL and the web application name, as Listing 5.7 shows.
New-SPAlternateURL -URL "http://intranet.sp2013.com" -WebApplication
"SharePoint - 80" -Internal -Zone Intranet
Using the -Internal
switch parameter creates the mapping for internal use. Omitting this parameter generates a public URL entry. Use the -Zone
parameter to specify the zone. The valid values follow:
• Default
• Intranet
• Internet
• Extranet
• Custom
Tip
For external resources, use the second parameter set which requires the external resource name (-ResourceName)
instead of the web application.
18.119.125.7