Remove-SPEnterpriseSearchQueryScope

删除查询范围。

语法

Remove-SPEnterpriseSearchQueryScope
      [-Identity] <ScopePipeBind>
      [-AssignmentCollection <SPAssignmentCollection>]
      [-Confirm]
      [-SearchApplication <SearchServiceApplicationPipeBind>]
      [-Url <Uri>]
      [-WhatIf]
      [<CommonParameters>]

说明

将搜索服务应用程序升级到 SharePoint Server 后,可以查看共享范围,但不能创建、更新或删除它们。 因此,您不能在升级后将此 cmdlet 用于共享范围。 不过,您可以将共享范围转换为结果源,这将达到相同的效果。 同样,将 SharePoint Server 网站集升级到 SharePoint Server 后,可以查看本地范围,但不能创建、更新或删除它们。 因此,在升级网站集后,无法将此 cmdlet 用于本地范围。 不过,您可以将本地范围转换为结果源,这将达到相同的效果。

Remove-SPEnterpriseSearchQueryScope cmdlet 从查询范围集合中删除一个或多个指定的共享范围。 查询范围表示服务器场中所有共享的搜索应用程序所使用的查询结果范围。

有关适用于 SharePoint 产品的 Windows PowerShell 的权限和最新信息,请参阅 https://go.microsoft.com/fwlink/p/?LinkId=251831 上的联机文档。

示例

------------------示例------------------

$ssa = Get-SPenterpriseSearchServiceApplication -Identity MySSA
Get-SPEnterpriseSearchQueryScope -Identity MustCrawl -SearchApplication $ssa | Remove-SPEnterpriseSearchQueryScope

此示例从名为 MySSA 的 Search Service 应用程序中删除名为 MustCrawl 的范围。

参数

-Confirm

执行命令前,看到确认提示。 有关详细信息,请键入以下命令: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

-Identity

指定要删除的查询范围。

键入的值必须为 12345678-90ab-cdef-1234-567890bcdefgh 形式的有效 GUID;有效的范围名称(如 Scope1);或有效 Scope 对象的实例。

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

-SearchApplication

指定包含查询范围集合的搜索应用程序。

键入的值必须为 12345678-90ab-cdef-1234-567890bcdefgh 形式的有效 GUID;有效的搜索应用程序名称(如 SearchApp1);或有效 SearchServiceApplication 对象的实例。

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

-Url

用于删除指定结果 URL 的范围的筛选器。

键入的值必须为有效的 URL,格式为 https://server_name。

Type:Uri
Aliases:u
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