How to Force Stop a Microsoft Search Server 2010 Crawl

  • Updated

In some cases stopping a crawl does not work through sharepoint central administration or through the Ektron workarea. Here are the steps to force stop it through powershell. 

  1. Login to the search server with your search service user. This user can be identified by looking at the log on as property of the Sharepoint Server Search 14 service.  
  2. Create a file with a .ps1 extension. For this example we are calling it crawlstop.ps1.
  3. Add the following text to the file. 
    Get-SPEnterpriseSearchCrawlContentSource -SearchApplication "Search Service Application" | ForEach-Object {
    if ($_.CrawlStatus -ne "Idle")
    {
    Write-Host "Stopping currently running crawl for content source $($_.Name)..."
    $_.StopCrawl()

    do { Start-Sleep -Seconds 1 }
    while ($_.CrawlStatus -ne "Idle")
    }
    }
  4. Run SharePoint 2010 Management Shell as an admin user.
  5. Give the path of the file to run the script and stop the crawl. 
    e.g. c:\crawlstop\crawlstop.ps1

Other Resources

Script adapted from http://get-spscripts.com/2012/05/force-stop-and-then-start-full-crawl-on.html