Disable Continuous Crawl in SharePoint Server using PowerShell?

Continuous Crawl in SharePoint helps to keep the search results up to date. Configuring continuous crawl is explained in another article: Configure Continuous Crawl in SharePoint 2016. In some situations like maintenance, Index reset, etc., you may have to turn off continuous crawl in SharePoint.

How to Disable Continuous Crawl in SharePoint 2016 using PowerShell?

To disable continuous crawl on a specific SharePoint content source, follow these steps:

  • Login to SharePoint 2013 Central Administration as a Farm administrator. In Central Administration, Under Application Management, click on Manage service applications, and Pick your Search service application
  • On the Search Service Administration page, click on the Content Sources link under the crawling section of the left navigation menu.
  • In the Manage Content Sources page, click on the drop-down arrow from the SharePoint content source to which you want to disable continuous crawl.
  • Select Disable Continuous crawl and confirm that you want to disable continuous crawl by clicking OK. You can also disable continuous crawl by selecting the Incremental Crawls option from the edit content sources page, which disables continuous crawl. 
    sharepoint 2013 disable continuous crawl powershell

SharePoint 2013 disable continuous crawl using PowerShell:

Use this PowerShell script to disable continuous crawl for a specific content source in SharePoint 2013 or SharePoint 2016.

#Get Search service application
$SSA =  Get-SPEnterpriseSearchServiceApplication
 
#Get the content source by name
$ContentSource = Get-SPEnterpriseSearchCrawlContentSource -SearchApplication $SSA -Identity "Local SharePoint sites"
 
#Check if Continuous Crawls is already disabled
if($ContentSource.EnableContinuousCrawls -eq $False)
{
    Write-host "Continuous Crawl is already Disabled on this content source!" -ForegroundColor Red
}
else
{
    #Disable continuous crawl sharepoint 2013
    Set-SPEnterpriseSearchCrawlContentSource -Identity $ContentSource -EnableContinuousCrawls $False
    Write-host "Disabled Continuous Crawl Successfully!" -ForegroundColor Green
}

Disable continuous crawl SharePoint 2016 with PowerShell

Let’s disable continuous crawl for all SharePoint content sources.

#Get Search service application
$SSA =  Get-SPEnterpriseSearchServiceApplication

#Get all SharePoint content sources
$SPContentSources = Get-SPEnterpriseSearchCrawlContentSource -SearchApplication $SSA | Where-object {$_.Type -eq "SharePoint"} 

foreach ($ContentSource in $SPContentSources) 
{ 
    #Check if Continuous Crawls is disabled already
    if($ContentSource.EnableContinuousCrawls -eq $false)
    {
     Write-host "Continuous Crawl is already Disabled for $($ContentSource.Name)!" -ForegroundColor Yellow
    }
    else
    {
        #disable continuous crawl sharepoint 2013
        Set-SPEnterpriseSearchCrawlContentSource -Identity $ContentSource -EnableContinuousCrawls $False
     Write-host "Disabled Continuous Crawl Successfully for $($ContentSource.Name)" -ForegroundColor Green
    }
}

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

Leave a Reply

Your email address will not be published. Required fields are marked *