SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there an API to determine if Sharepoint/MOSS/SearchServer is currently crawling a particular content source?

share|improve this question

Here is how you can determine the crawling status for SharePoint 2010:

SearchService searchService = SearchService.Service;
// replace "Search Service Application" with actual Search Service Application Name
SearchServiceApplication searchApp = 
          searchService.SearchApplications.GetValue<SearchServiceApplication>("Search Service Application"); 

Content content = new Content(searchApp);

foreach (ContentSource contentSource in content.ContentSources)
       Console.WriteLine(string.Format("{0}: {1}", contentSource.Name, contentSource.CrawlStatus));

The content source crawl status is retrieved via ContentSource class. It is available for both SharePoint 2010 and SharePoint 2007. You can check MSDN sample for SharePoint 2007 here.

In 2010, it's even easier with PowerShell:

Get-SPEnterpriseSearchServiceApplication | Get-SPEnterpriseSearchCrawlContentSource
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.