-
Notifications
You must be signed in to change notification settings - Fork 107
SPSearchContentSource
dscbot edited this page Mar 17, 2023
·
18 revisions
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
Name | Key | String | The name of the content source | |
ServiceAppName | Key | String | The name of the search service app that this content source exists within | |
ContentSourceType | Required | String | The type of content source - currently only SharePoint, Website, File Shares and Business are supported |
SharePoint , Website , FileShare , Business
|
Addresses | Write | StringArray[] | A list of the addresses this content source includes | |
CrawlSetting | Write | String | Should the crawler index everything, just the first site or page, or a custom depth (applies to websites only) |
CrawlEverything , CrawlFirstOnly , CrawlVirtualServers , CrawlSites , Custom
|
ContinuousCrawl | Write | Boolean | Should this content source use continuous crawl (SharePoint sites only) | |
IncrementalSchedule | Write | MSFT_SPSearchCrawlSchedule | What is the incremental schedule for this content source | |
FullSchedule | Write | MSFT_SPSearchCrawlSchedule | What is the full schedule for this content source | |
Priority | Write | String | What is the priority on this content source |
Normal , High
|
LimitPageDepth | Write | UInt32 | How many pages deep should the crawler go (-1 = unlimited, website sources only) | |
LimitServerHops | Write | UInt32 | How many server hops should the crawler make (-1 = unlimtied, website sources only) | |
LOBSystemSet | Write | StringArray[] | Line of Business System and System Instance names | |
Ensure | Write | String | Present if the source should exist, absent if it should not |
Present , Absent
|
Force | Write | Boolean | Specify true if DSC is allowed to delete and recreate a content source to apply the correct settings, otherwise false will just report errors if a change can not be applied. |
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
ScheduleType | Required | String | How frequently should this crawl be run |
None , Daily , Weekly , Monthly
|
CrawlScheduleDaysOfMonth | Write | UInt32 | Monthly crawls only: Which day of the month should the crawl run on | |
CrawlScheduleDaysOfWeek | Write | StringArray[] | Weekly crawls only: What days should the crawl be run on |
Everyday , Weekdays , Weekends , Monday , Tuesday , Wednesday , Thursday , Friday , Saturday , Sunday
|
CrawlScheduleMonthsOfYear | Write | StringArray[] | Monthly crawls only: Which months should this crawl be run during |
AllMonths , January , February , March , April , May , June , July , August , September , October , November , December
|
StartHour | Write | UInt32 | The hour of the day that the schedule should begin | |
StartMinute | Write | UInt32 | The minute of the specified hour that the schedule should begin | |
CrawlScheduleRepeatDuration | Write | UInt32 | Specifies the number of times to repeat the crawl within a day | |
CrawlScheduleRepeatInterval | Write | UInt32 | Specifies the number of minutes between crawl repeats on a day | |
CrawlScheduleRunEveryInterval | Write | UInt32 | For daily crawls, this is the number of days between crawls. For weekly this is the number of weeks between crawls |
Type: Distributed Requires CredSSP: No
This resource will deploy and configure a content source in a specified search service application.
The CrawlSetting is used to control crawl scope. SharePoint sources can utilize CrawlVirtualServers to crawl the entire server and all site collections on the server or CrawlSites to crawl only particular site collections.
The default value for the Ensure parameter is Present. When not specifying this parameter, the content source is created.
This example shows how to create a SharePoint sites content source
Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[PSCredential]
$SetupAccount
)
Import-DscResource -ModuleName SharePointDsc
node localhost
{
SPSearchContentSource LocalSharePointSites
{
Name = "Local SharePoint Sites"
ServiceAppName = "Search Service Application"
ContentSourceType = "SharePoint"
Addresses = @("http://sharepointsite1.contoso.com", "http://sharepointsite2.contoso.com")
CrawlSetting = "CrawlSites"
ContinuousCrawl = $true
FullSchedule = $null
Priority = "Normal"
Ensure = "Present"
PsDscRunAsCredential = $SetupAccount
}
}
}
This example shows how to create a website content source
Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[PSCredential]
$SetupAccount
)
Import-DscResource -ModuleName SharePointDsc
node localhost
{
SPSearchContentSource WebsiteSource
{
Name = "Contoso website"
ServiceAppName = "Search Service Application"
ContentSourceType = "Website"
Addresses = @("http://www.contoso.com")
CrawlSetting = "Custom"
LimitPageDepth = 5
IncrementalSchedule = MSFT_SPSearchCrawlSchedule {
ScheduleType = "Daily"
StartHour = "0"
StartMinute = "0"
CrawlScheduleRepeatDuration = "1440"
CrawlScheduleRepeatInterval = "5"
}
FullSchedule = MSFT_SPSearchCrawlSchedule {
ScheduleType = "Weekly"
CrawlScheduleDaysOfWeek = @("Monday", "Wednesday", "Friday")
StartHour = "3"
StartMinute = "0"
}
Priority = "Normal"
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