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

according to that technet article it is possible to reset manually the content index.

I was wondering if that task could be plan to run once a week for instance, automatically?

share|improve this question
up vote 2 down vote accepted

I could find no OOB way to do this in stsadm or PowerShell, so you could either write a server specific custom timer job that does this at pre-scheduled interval, or create a PowerShell cmdlet that is called using schedule on the server that runs the Search Service Application.

using Microsoft.Office.Server.Administration;
using Microsoft.Office.Server.Search.Administration;

public static void ResetContent()

                SearchContext searchContext = SearchContext.GetContext(ServerContext.Default);
            catch (Exception ex)
                throw new InvalidOperationException("Unable to reset content index.", ex);



Alternatively in PowerShell

$searchApp = Get-SPEnterpriseSearchServiceApplication -Identity “SearchAppName”                                                        

if($searchApp -ne $null) {

  $searchAppCtx = [Microsoft.Office.Server.Search.Administration.SearchContext]::GetContext($searchApp)



Corey Roth also coded this functionality as a cmdlet in his SharePoint PowerShell Community Toolkit

share|improve this answer

didn't try, but you can try in powershell:

$searchapp = Get-SPEnterpriseSearchServiceApplication
$searchapp.Reset($true, $false)

then you can schedule the powershell command

share|improve this answer
beat me by 43 sec ;-) – Anders Rask Jun 22 '11 at 10:05
@anders rask: as your answer is more complete than mine, let's say the score is 1:1 (and user472285 be the judge to mark as answer) :) – Steve B Jun 22 '11 at 10:11

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.