Muokkaa

Jaa


New-SPAlternateURL

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

Syntax

New-SPAlternateURL
   [-Url] <String>
   -WebApplication <SPWebApplicationPipeBind>
   [-AssignmentCollection <SPAssignmentCollection>]
   [-Confirm]
   [-Internal]
   [-WhatIf]
   [-Zone <SPUrlZone>]
   [<CommonParameters>]
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

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.

Type:SPAssignmentCollection
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-Confirm

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

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-Internal

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

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-ResourceName

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

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-Url

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.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-WebApplication

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.

Type:SPWebApplicationPipeBind
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-WhatIf

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

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-Zone

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.

Type:SPUrlZone
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition