Steps
  • Start your windows PowerShell on your computer.
  • Right click and select Run as administrator option.
  • Paste the below script on the PowerShell window and click the enter button.
  • Check your SharePoint site Feature will activated successfully
The script below walks through each content source and does the following:
  1. Checks whether the crawl status is set to “Idle”
  2. If the content source is currently involved in a crawl activity, stop the activity and wait until the status changes back to Idle
  3. If the content source is Idle, then start a full crawl
  1. Get-SPEnterpriseSearchCrawlContentSource -SearchApplication "Search Service Application" | ForEach-Object {
  2. if ($_.CrawlStatus -ne "Idle")
  3. {
  4. Write-Host "crawl stooping currently for content source $($_.Name)..."
  5. $_.StopCrawl()
  6. do { Start-Sleep -Seconds 1 }
  7. while ($_.CrawlStatus -ne "Idle")
  8. }
  9. Write-Host "Full crawl started for content source $($_.Name)..."
  10. $_.StartFullCrawl()
  11. }
Run the script and following script if you want to display the crawl status of all content sources on your farm:
  1. Get-SPEnterpriseSearchCrawlContentSource -SearchApplication "Search Service Application" | select Name, CrawlStatus