Sunday, March 13, 2016

Disable Continuous Crawl in SharePoint 2013 using PowerShell

Continuous Crawl in SharePoint 2013 helps to keep the search results upto date. In some situations like maintenance, Index reset, etc you may have to turn-off continuous crawl in SharePoint. 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
  • In Search Service Administration page, click on Content Sources link under 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 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
Lets 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
    {
        #enable continuous crawl sharepoint 2013
        Set-SPEnterpriseSearchCrawlContentSource -Identity $ContentSource -EnableContinuousCrawls $False
     Write-host "Disabled Continuous Crawl Successfully for $($ContentSource.Name)" -ForegroundColor Green
    }
}



You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Check out these SharePoint products:

No comments :

Post a Comment

Please Login and comment to get your questions answered!


You might also like:

Related Posts Plugin for WordPress, Blogger...