Wednesday, November 26, 2014

Stop forcefully SharePoint Search Crawl through PowerShell

Sometime, it happens that we want to stop search crawl but from Central Administration Site, Stop Crawl link doesn’t work. To stop Search Crawl forcefully in SharePoint, we can use this script.

Get-SPEnterpriseSearchCrawlContentSource -SearchApplication "Search Service Application" | ForEach-Object {
    if ($_.CrawlStatus -ne "Idle")
    {
        Write-Host "Stopping : Crawl is currently running for content source $($_.Name)..."
        $_.StopCrawl()
    }
}

No comments:

Post a Comment