top of page
Writer's pictureSubir Hazra

SharePoint Content Source: Configuring and Managing with Central Admin and PowerShell Scripting

In SharePoint, a content source refers to a predefined set of options that determine what, when, and how content should be crawled by the search system. When you create a Search service application in SharePoint, a default content source named "Local SharePoint sites" is automatically created. This content source is configured to crawl all SharePoint Server sites within the local server farm.


However, you can also create additional content sources to specify other types of content that you want to be crawled and indexed by SharePoint. For example, you might create a content source to crawl file shares, external websites, or Exchange Public Folders.


Each content source allows you to configure specific settings such as the start addresses from where the crawler should begin crawling, the type of content to be crawled, the crawl schedule, and authentication methods. By defining these settings, you can control which content is included in the search index and how frequently it is updated.


Content sources provide flexibility in managing and customizing the search experience in SharePoint. You can create, edit, or delete content sources based on your requirements to ensure that the search system covers the desired content and retrieves up-to-date information for users.


SharePoint Content Source
SharePoint Content Source

Configure Content Source from Central Admin


To create, edit, or delete a content source in SharePoint, follow these steps:


1. Open the SharePoint Central Administration site.

2. Navigate to the "Application Management" section.

3. Click on "Manage service applications" to access the list of service applications.

4. Locate and click on the "Search Service Application" associated with the content source you want to manage.

5. In the Search Service Application page, click on "Content Sources" in the left navigation menu. This will display the list of existing content sources.

6. To create a new content source:

- Click on "New Content Source" to start the creation process.

- Provide a name and description for the content source.

- Specify the start addresses from where the crawler should begin indexing content.

- Configure other settings such as crawl schedules, authentication, and permissions as needed.

- Save the content source.

7. To edit an existing content source:

- Select the desired content source from the list.

- Click on "Edit" to modify the settings.

- Update the necessary properties, such as start addresses, crawl schedules, or authentication options.

- Save the changes.

8. To delete a content source:

- Select the content source you wish to delete.

- Click on "Delete" to remove the content source from the list.


It's important to note that when you create, edit, or delete a content source, it may impact the crawling and indexing behavior in your SharePoint environment. Therefore, it's recommended to carefully review the settings and their impact before making any changes. Additionally, ensure that you have the necessary permissions to manage content sources in the SharePoint Central Administration site.


Add Content Source page
Add Content Source page

Create a new content source using PowerShell


Please refer to the following PowerShell code to create a SharePoint content source:


Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue
 
#Variables for new content source creation
$ContentSourceName= "Intranet Portal" #default "Local SharePoint sites"
$ContentSourceType="SharePoint"
$ContnetSourceURL="https://portal.crescent.com"
 
#Get the search service application
$SSA = Get-SPEnterpriseSearchServiceApplication #-Identity "Search Service Application Name"
 
#Check if the given content source Name exits already
$ContentSource = Get-SPEnterpriseSearchCrawlContentSource -SearchApplication $SSA | where {$_.Name -eq $ContentSourceName}
if ($ContentSource)
{
    write-host "Content Source Name already exist!" -f Red
    exit
}
  
#Create new content source
$ContentSource = New-SPEnterpriseSearchCrawlContentSource -SearchApplication $SSA -Type $ContentSourceType `
          -name $ContentSourceName -StartAddresses $ContnetSourceURL -MaxSiteEnumerationDepth 0
 
write-host "New Content Source has been created!" -f Green
 
#To delete a content source, use: 
#Remove-SPEnterpriseSearchCrawlContentSource -SearchApplication $SSA -Identity $ContentSourceNames

24 views0 comments

Comments


Disclaimer

Welcome to my professional blog! The articles shared here are based on my personal experiences and knowledge, intended to serve as a valuable reference for myself and to assist readers like you.

 

Kindly refrain from reproducing my content in any manner without obtaining my explicit permission. In the event that any article infringes upon copyright regulations, please don't hesitate to reach out to me. I appreciate your input and encourage you to share your insights or alternative solutions by leaving a comment. Your valuable contributions are highly appreciated!

Copyright © 2023 by SHAREPOINT INSIGHTS. All rights reserved.

bottom of page