-
Notifications
You must be signed in to change notification settings - Fork 107
SPSearchResultSource
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
Name | Key | String | The name of the result source | |
ScopeName | Key | String | The scope at which the Result Source will be created. Options are SSA, SPSite or SPWeb |
SSA , SPSite , SPWeb
|
ScopeUrl | Key | String | The URI of the site where to create the result source. Use 'Global' if ScopeName is SSA | |
SearchServiceAppName | Required | String | The name of the search service application to associate this result source with | |
Query | Required | String | The query to pass to the provider source | |
ProviderType | Required | String | The provider type to use for the result source | |
ConnectionUrl | Write | String | The URI to connect to the remote location | |
Ensure | Write | String | Present if the result source should exist, absent if it should not |
Present , Absent
|
Type: Distributed Requires CredSSP: No
This resource is used to configure search result sources in the SharePoint search service application. Result sources can be configured to be of the following provider types:
- Exchange Search Provider
- Local People Provider
- Local SharePoint Provider
- OpenSearch Provider
- Remote People Provider
- Remote SharePoint Provider
Important: The above provider types are specific to the used localized version of SharePoint. Please make sure you use the correct localized values. Use the below script to check of all possible values.
The default value for the Ensure parameter is Present. When not specifying this parameter, the result source is created.
To define a result source as global, use the value 'SSA' as the ScopeName value and 'Global' as the ScopeUrl value (the parameter needs to have a value).
$serviceApp = Get-SPEnterpriseSearchServiceApplication -Identity "SearchServiceAppName"
$fedManager = New-Object Microsoft.Office.Server.Search.Administration.Query.FederationManager($serviceApp)
$providers = $fedManager.ListProviders()
$providers.Keys
This example shows how to create a remote sharepoint search result source
Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[PSCredential]
$SetupAccount
)
Import-DscResource -ModuleName SharePointDsc
node localhost
{
SPSearchResultSource RemoteSharePointFarm
{
Name = "External SharePoint results"
ScopeName = "SPSite"
ScopeUrl = "https://SharePoint.contoso.com"
SearchServiceAppName = "Search Service Application"
Query = "{searchTerms}"
ProviderType = "Remote SharePoint Provider"
PsDscRunAsCredential = $SetupAccount
}
}
}
This example shows how to create a Search Service Application scoped sharepoint search result source
Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[PSCredential]
$SetupAccount
)
Import-DscResource -ModuleName SharePointDsc
node localhost
{
SPSearchResultSource Intranet
{
Name = "Intranet"
ScopeName = "SSA"
ScopeUrl = "Global"
SearchServiceAppName = "Search Service Application"
Query = '{searchTerms}'
ProviderType = "Local SharePoint Provider"
Ensure = "Present"
PsDscRunAsCredential = $SetupAccount
}
}
}
- Home
- Getting Started
- Pre-requisites
- Installing the module
- Exporting SharePoint Configuration
- Creating Configuration Files
- Pre-created Examples
- Creating an Azure development environment
- Understanding Resources & Syntax
- Remote PowerShell Authentication
- Contributing to SharePointDsc
- Other useful modules for SharePoint DSC configurations