Set-SPEnterpriseSearchResultSource

设置结果源的属性。

语法

Default (默认值)

Set-SPEnterpriseSearchResultSource
    [-AssignmentCollection <SPAssignmentCollection>]
    [-AuthenticationType <FederationAuthType>]
    [-AutoDiscover <Boolean>]
    [-Confirm]
    [-Description <String>]
    -Identity <ResultSourcePipeBind>
    [-MakeDefault <Boolean>]
    [-Name <String>]
    [-Owner <SearchObjectOwner>]
    [-Password <String>]
    [-ProviderId <Guid>]
    [-QueryTemplate <String>]
    [-RemoteUrl <String>]
    [-SearchApplication <SearchServiceApplicationPipeBind>]
    [-SsoId <String>]
    [-UserName <String>]
    [-WhatIf]
    [<CommonParameters>]

说明

此 cmdlet 可更新用户创建的结果源的属性。 此 cmdlet 支持通过管理中心的“管理结果源”页支持的相同更新作。 对于除使用 MakeDefault 参数更改默认结果源以外的任何更新操作,结果源都不能为内置源(内置源的 BuiltIn 属性设置为 true)。 有关适用于 SharePoint 产品的 Windows PowerShell 的权限和最新信息,请参阅 SharePoint Server cmdlet

示例

示例 1

$ssa = Get-SPEnterpriseSearchServiceApplication
$owner = Get-SPEnterpriseSearchOwner -Level SSA
$customResultSource = New-SPEnterpriseSearchResultSource -SearchApplication $ssa -Owner $owner -ProviderId fa947043-6046-4f97-9714-40d4c113963d -Name "Custom SharePoint Result Source"
Set-SPEnterpriseSearchResultSource -Identity $customResultSource -Name "Basic SharePoint Result Source"

此示例更新结果源的名称,并将结果源的标识指定为结果源实例。 此更新作不需要 SearchApplication 和 Owner。

示例 2

$ssa = Get-SPEnterpriseSearchServiceApplication
$owner = Get-SPEnterpriseSearchOwner -Level SSA
$customResultSource = New-SPEnterpriseSearchResultSource -SearchApplication $ssa -Owner $owner -ProviderId fa947043-6046-4f97-9714-40d4c113963d -Name "Custom SharePoint Result Source"
Set-SPEnterpriseSearchResultSource -SearchApplication $ssa -Owner $owner -Identity "Custom SharePoint Result Source" -Description "A custom SharePoint Result Source for demonstration purposes"

此示例更新结果源的说明,结果源的标识由名称指定。

参数

-AssignmentCollection

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

管理对象以便正确进行处理。 使用 SPWeb 或 SPSite 等对象可能会耗用大量内存,而且在 Windows PowerShell 脚本中使用这些对象需要正确管理内存。 通过使用 SPAssignment 对象,可以将对象分配给变量,然后在不需要这些对象时对它们进行处理,以释放内存。 在使用 SPWeb、SPSite 或 SPSiteAdministration 对象时,如果不使用分配集合或 Global 参数,则会自动处理这些对象。

使用全局参数时,所有对象均包含在全局存储中。 如果未立即使用对象,或未通过使用 Stop-SPAssignment 命令来处理对象,则可能会发生内存不足的情况。

参数属性

类型:SPAssignmentCollection
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:True
来自管道的值(按属性名称):False
来自剩余参数的值:False

-AuthenticationType

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定结果源的身份验证类型。 如果未指定参数,则值不会更改。

每种搜索提供程序类型都支持一组特定的身份验证类型,如果未指定参数,身份验证类型将基于搜索提供程序类型默认。

此 cmdlet 支持以下一组身份验证机制和相应类型:默认 SharePoint 身份验证 (FederationAuthType.LocalNTAuth) 、Basic Authentication (FederationAuthType.SingleAccountBasicAuth - 指定 UserName 和 Password) 、Default Remote SharePoint Authentication (FederationAuthType.PerUserBasicAuth) 、单一登录 (FederationAuthType.SSO - 要求) 指定 SsoId, 匿名 (FederationAuthType.Anonymous) 、Digest Authentication (FederationAuthType.SingleAccountDigest - 指定用户名和密码) 、NTLM 应用程序池标识 (FederationAuthType.ApplicationPoolIdentity) 、NTLM 用户名和密码 (FederationAuthType.SingleAccountNTLM - 指定 UserName 和 Password) 。

使用本地 SharePoint 搜索/本地 SharePoint 人员搜索提供程序时,支持 FederationAuthType.LocalNTAuth (默认) 和 FederationAuthType.SingleAccountBasicAuth。

使用远程 SharePoint 搜索/远程 SharePoint 人员搜索提供程序时,支持 FederationAuthType.PerUserBasicAuth (默认) 和 FederationAuthType.SSO。

使用 OpenSearch 1.0/1.1 搜索提供程序时,支持以下身份验证类型:FederationAuthType.Anonymous (默认) 、FederationAuthType.SingleAccountBasicAuth、FederationAuthType.SingleAccountDigest、FederationAuthType.SingleAccountNTLM 和 FederationAuthType.ApplicationPoolIdentity。

枚举 FederationAuthType 中列出了所有身份验证类型。

参数属性

类型:FederationAuthType
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-AutoDiscover

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定是否对结果源使用 Exchange 服务器终结点的自动发现。

将值设置为 true ($true) 表明应使用自动发现。

如果未指定参数,则值不会更改。

仅当使用 Exchange 搜索提供程序时适用。

参数属性

类型:Boolean
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Confirm

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

执行命令前,看到确认提示。 有关详细信息,请键入以下命令:get-help about_commonparameters

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False
别名:cf

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Description

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定结果源说明。

如果未指定参数,则值不会更改。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Identity

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定要更新的结果源。

键入的值必须为 12345678-90ab-cdef-1234-567890bcdefgh 形式的有效 GUID 字符串;结果源的有效名称(例如“自定义 SharePoint 结果源”);或者有效 Source 对象的实例。

参数属性

类型:ResultSourcePipeBind
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:True
来自管道的值:True
来自管道的值(按属性名称):False
来自剩余参数的值:False

-MakeDefault

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定是否应将结果源设置为由 Owner 参数指定的作用域的默认结果源。

如果未指定参数,则默认结果源不会更改。

将值设置为 ($true) 表明应将结果源设置为默认结果源。

将值设置为 false ($false) 表示不应将结果源设置为默认值,在这种情况下,如果要更新的结果源当前为默认值,则原始默认结果源 (“本地 SharePoint 结果”) 将再次设置为默认值。

提示:使用 Makedefault 时,请使用实例(而不是名称或 GUID 字符串 ID)作为 Identity,明确指定“所有者”仅用于指定结果源应设置为默认 (如果值为 true) ,则默认值应重置为原始 ((如果值为 false) )。

参数属性

类型:Boolean
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Name

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定结果源名称。

如果未指定参数,则值不会更改。

名称在每个管理级别必须唯一。

例如,一个网站中的两个结果源不能使用同一个名称,但网站中的结果源可以与网站集提供的结果源使用同一个名称。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Owner

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定用于定义相应结果源可用的范围的搜索对象所有者。

参数属性

类型:SearchObjectOwner
默认值:None
支持通配符:False
不显示:False
别名:o

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Password

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定用于连接到结果源的用户凭据的密码。

如果未指定参数,则值不会更改。

当身份验证类型 (AuthenticationType) 设置为使用用户凭据的类型(FederationAuthType.SingleAccountBasicAuth、FederationAuthType.SingleAccountDigest 或 FederationAuthType.SingleAccountNTLM)时使用。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-ProviderId

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定结果源将使用的搜索提供程序。

如果未指定参数,则值不会更改。

指定为 Guid 或 GUID 字符串,字符串必须为以下值之一:FA947043-6046-4F97-9714-40D4C113963D(本地 SharePoint 搜索)、E4BCC058-F133-4425-8FFC-1D70596FFD33(本地 SharePoint 人员搜索)、1E0C8601-2E5D-4CCB-9561-53743B5DBDE7(远程 SharePoint 搜索)、E377CAAA-FCAF-4a1b-B7A1-E69A506A07AA(远程 SharePoint 人员搜索)、3A17E140-1574-4093-BAD6-E19CDF1C0122(Exchange 搜索)、3A17E140-1574-4093-BAD6-E19CDF1C0121 (OpenSearch 1.0/1.1)。

参数属性

类型:Guid
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-QueryTemplate

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定结果源的查询转换模板。

如果未指定参数,则值不会更改。

传入查询根据模板进行更改,以转为使用此新的查询文本。 通过使用查询变量“{searchTerms}”将传入查询包括在新文本中。 使用此变量确定结果范围。

例如,若要仅返回 OneNote 项目,请将新文本设置为“{searchTerms} fileextension=one”。 然后传入查询“sharepoint”将变为“sharepoint fileextension=one”。 默认值为 {searchTerms}。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-RemoteUrl

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定结果源的连接 URL 模板。

如果未指定参数,则值不会更改。

使用消耗它的搜索提供程序时必须设置:远程 SharePoint 搜索、远程 SharePoint 人员搜索、OpenSearch 1.0/1.1 和 Exchange(如果未启用 AutoDiscover)。

使用其他搜索提供程序时则忽略此参数。

对于远程 SharePoint 搜索/远程 SharePoint 人员搜索,请指定远程 SharePoint 服务器场的根网站集的地址。

对于 OpenSearch 1.0/1.1,请指定 OpenSearch 源的 URL。

通过使用查询变量“{searchTerms}”将查询包括在 URL 中,此变量将被查询自动替换。 对于 Exchange,请指定要从其检索结果的 Exchange EWS URL。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-SearchApplication

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定搜索应用程序。

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

参数属性

类型:SearchServiceApplicationPipeBind
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:True
来自管道的值(按属性名称):False
来自剩余参数的值:False

-SsoId

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定用于连接到结果源的反向代理证书安全存储 ID。

如果未指定参数,则值不会更改。

如果身份验证类型 (AUthenticationType) 设置为 FederationAuthType.SSO (单一登录) ,则必须指定。

如果您通过反向代理连接到 Intranet,请输入单一登录条目的 SSO ID,其中存储了用于对反向代理进行身份验证的证书。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-UserName

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定用于连接到结果源的用户凭据的用户名。

如果未指定参数,则值不会更改。

当身份验证类型 (AuthenticationType) 设置为使用用户凭据的类型(FederationAuthType.SingleAccountBasicAuth、FederationAuthType.SingleAccountDigest 或 FederationAuthType.SingleAccountNTLM)时使用。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-WhatIf

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

显示一条描述命令作用的消息,而不执行命令。 有关详细信息,请键入以下命令:get-help about_commonparameters

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False
别名:无线

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

CommonParameters

此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters