New-SPEnterpriseSearchResultSource
创建新的结果源。
语法
Default (默认值)
New-SPEnterpriseSearchResultSource
[-AssignmentCollection <SPAssignmentCollection>]
[-AuthenticationType <FederationAuthType>]
[-AutoDiscover <Boolean>]
[-Confirm]
[-Description <String>]
[-MakeDefault <Boolean>]
-Name <String>
-Owner <SearchObjectOwner>
[-Password <String>]
-ProviderId <Guid>
[-QueryTemplate <String>]
[-RemoteUrl <String>]
-SearchApplication <SearchServiceApplicationPipeBind>
[-SsoId <String>]
[-UserName <String>]
[-WhatIf]
[<CommonParameters>]
说明
此 cmdlet 可创建结果源。 使用结果源确定搜索结果的范围并将查询汇总到外部源,例如 Internet 搜索引擎。 定义结果源后,配置搜索 Web 部件及使用它的查询规则操作。 结果源将取代搜索范围(现已弃用)。 此 cmdlet 支持通过管理中心的“管理结果源”页支持的相同创建作,但“表单身份验证”和“Cookie 身份验证”作除外。 有关适用于 SharePoint 产品的 Windows PowerShell 的权限和最新信息,请参阅 SharePoint Server cmdlet。
示例
例
$ssa = Get-SPEnterpriseSearchServiceApplication
$owner = Get-SPEnterpriseSearchOwner -Level SSA
New-SPEnterpriseSearchResultSource -SearchApplication $ssa -Owner $owner -ProviderId fa947043-6046-4f97-9714-40d4c113963d -Name "Custom SharePoint Result Source"
此示例创建新的搜索服务应用程序级结果源,名为“自定义 SharePoint 结果源”。
参数
-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) 表明应使用自动发现。 如果未指定或设置为 false ($false),则不使用自动发现。
仅当使用 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 |
-MakeDefault
适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019
指定对于 Owner 参数指定的范围,是否应将新结果源设置为默认结果源。
将值设置为 ($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 |
| 必需: | True |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Owner
适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019
指定用于定义创建相应结果源的范围的搜索对象所有者。
参数属性
| 类型: | SearchObjectOwner |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
| 别名: | o |
参数集
(All)
| Position: | Named |
| 必需: | True |
| 来自管道的值: | 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 |
| 必需: | True |
| 来自管道的值: | 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 ((如果未打开自动发现) )。
使用其他搜索提供程序时则忽略此参数。
对于远程 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
指定搜索应用程序。
类型必须是有效的 GUID,格式为 12345678-90ab-cdef-1234-567890bcdefgh;有效的搜索应用程序名称,例如 SearchApp1 或有效 SearchServiceApplication 对象的实例。
参数属性
| 类型: | SearchServiceApplicationPipeBind |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | True |
| 来自管道的值: | 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。