Remove-SPManagedPath

从指定的主机标头或 Web 应用程序删除指定的管理路径。

语法

Remove-SPManagedPath
      [-Identity] <SPPrefixPipeBind>
      [-HostHeader]
      [-AssignmentCollection <SPAssignmentCollection>]
      [-Confirm]
      [-WhatIf]
      [<CommonParameters>]
Remove-SPManagedPath
      [-Identity] <SPPrefixPipeBind>
      -WebApplication <SPWebApplicationPipeBind>
      [-AssignmentCollection <SPAssignmentCollection>]
      [-Confirm]
      [-WhatIf]
      [<CommonParameters>]

说明

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.

Remove-SPManagedPath cmdlet 从主机标头或 Web 应用程序中删除 Identity 参数指定的托管路径。 Identity 必须是要删除的管理路径的部分 URL。

如果使用的是主机名网站集,请指定 HostHeader 参数。 若要删除主机名网站集托管路径,请提供 HostHeader 开关。 否则,必须指定包含要删除的管理路径的 Web 应用程序。

有关适用于 SharePoint 产品的 Windows PowerShell 的权限和最新信息,请参阅 SharePoint Server cmdlet

示例

----------------------示例 1----------------------------

Remove-SPManagedPath "sites" -HostHeader

本示例从主机名网站集托管路径列表中删除站点托管路径。

根据本地系统确认级别的不同,上面的示例可以在执行之前对用户进行提示。

------------------示例 2-----------------------

Get-SPWebApplication | Remove-SPManagedPath "personal" -confirm:$false

此示例从服务器场中所有的 Web 应用程序中删除 personal 管理路径。 此命令不提示用户进行确认。

参数

-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
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-HostHeader

指定 Identity 是主机头管理路径。

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

-Identity

Specifies the name of the managed path to delete. For example, in the URL https://sitename/sites/site1, "sites" is the name of the managed path.

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

-WebApplication

Specifies the identity of the Web application that hosts the managed path to delete. The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid Web application name (for example, WebApplication1212); or a valid name, in the form WebApp2423.

Type:SPWebApplicationPipeBind
Position:Named
Default value:None
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
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-工作分配

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
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition