Edit

Share via


New-SPAlternateURL

Creates a new public or internal URL for the specified Web application zone or resource.

Syntax

WebApplication

New-SPAlternateURL
    [-Url] <String>
    -WebApplication <SPWebApplicationPipeBind>
    [-AssignmentCollection <SPAssignmentCollection>]
    [-Confirm]
    [-Internal]
    [-WhatIf]
    [-Zone <SPUrlZone>]
    [<CommonParameters>]

ResourceName

New-SPAlternateURL
    [-Url] <String>
    -ResourceName <String>
    [-AssignmentCollection <SPAssignmentCollection>]
    [-Confirm]
    [-Internal]
    [-WhatIf]
    [-Zone <SPUrlZone>]
    [<CommonParameters>]

Description

This cmdlet contains more than one parameter set. You may only use parameters from one parameter set, and you may not combine parameters from different parameter sets. For more information about how to use parameter sets, see Cmdlet parameter sets.

The New-SPAlternateUrl cmdlet creates a new public or internal URL for the specified Web application zone or resource. Use the ResourceName parameter if the alternate URL is for an external resource.

Each Web application can be associated with a collection of mappings between internal and public URLs. Both internal and public URLs consist of the protocol and ___domain portion of the full URL; for example, https://www.fabrikam.com. Users type a public URL to get to the SharePoint site, and that URL appears in the links on the pages. Internal URLs are in the URL requests that are sent to the SharePoint site. Many internal URLs can be associated with a single public URL in multiserver farms; for example, when a load balancer routes requests to specific IP addresses to various servers in the load-balancing cluster.

Each Web application supports five collections of mappings per URL; the five collections correspond to five zones (default, intranet, extranet, Internet, and custom). When the Web application receives a request for an internal URL in a particular zone, links on the pages returned to the user have the public URL for that zone.

For permissions and the most current information about Windows PowerShell for SharePoint Products, see the online documentation at SharePoint Server Cmdlets.

Examples

EXAMPLE

#create the public URL
New-SPAlternateURL https://www.contoso.com -Zone "Internet"

#create the internal URL
New-SPAlternateURL https://sharepoint.contoso.com -Zone "Internet" -internal

This example translates incoming requests for https://www.contoso.com into https://sharepoint.contoso.com (on the Internet zone).

When a reverse proxy is being set up to handle public URL SSL termination, alternate access mappings must be configured to handle the URL translation.

Parameters

-AssignmentCollection

Applicable: SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Parameter properties

Type:SPAssignmentCollection
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Applicable: SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Internal

Applicable: SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

Makes this alternate URL an internal URL. If this parameter is not provided, the URL is a public URL.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResourceName

Applicable: SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

Specifies the resource name, if the alternate URL is for an external resource. If no value is specified, the value is left blank.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ResourceName
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Url

Applicable: SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

Specifies the public URL that users access to sign in to the Web application.

The type must be a valid URL, in the form https://server_name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:1
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-WebApplication

Applicable: SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

Specifies the name, URL, or GUID of the Web application for which to create the mapping.

The type must be a valid name, URL, in the form WebApplication-1212, https://server_name, or GUID, in the form 1234-5678-9876-0987.

Parameter properties

Type:SPWebApplicationPipeBind
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

WebApplication
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Applicable: SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Zone

Applicable: SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

Specifies one of the five zones with which the alternate URL is associated.

The type must be a valid zone: Default, Intranet, Internet, Extranet, or Custom.

Parameter properties

Type:SPUrlZone
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.