0

I simply want to run a ResetSearchIndex -force on a schedule. What is the correct usage for the command in the Scheduled Task properties? It seems I would first need to start Powershell, then load the console file or snap-in for Exchange, which one of these is the closest:

C:\WINDOWS\system32\WINDOW~2\v1.0\POWERS~1.EXE -"D:\Program Files\Microsoft\Exchange Server\Scripts" ResetSearchIndex.ps1 -force dbname

or

C:\WINDOWS\system32\WINDOW~2\v1.0\POWERS~1.EXE -PSConsoleFile "D:\Program Files\Microsoft\Exchange Server\bin\exshell.psc1" -noexit -command ".'D:\Program Files\Microsoft\Exchange Server\Scripts' ResetSearchIndex.ps1 -force dbname

or

C:\WINDOWS\system32\WINDOW~2\v1.0\POWERS~1.EXE -PSConsoleFile "D:\Program Files\Microsoft\Exchange Server\bin\exshell.psc1" -noexit -command ".'D:\Program Files\Microsoft\Exchange Server\Scripts\ResetSearchIndex.ps1' -force dbname

2 Answers2

2

The third option should do what you want:

C:\WINDOWS\system32\WINDOW~2\v1.0\POWERS~1.EXE -PSConsoleFile "D:\Program 
Files\Microsoft\Exchange Server\bin\exshell.psc1" -noexit -command ".'D:\Program 
Files\Microsoft\Exchange Server\Scripts\ResetSearchIndex.ps1' -force dbname
Sam Cogan
  • 38,736
  • 6
  • 78
  • 114
0

The third option will do what you want but why do you want to do this? This command will delete the index and rebuild the catalog. Thi will create 10 crawler threads and reset all mailboxes from notification to notstarted (except for the initial 10). I can see doing this when it's corrupted, otherwise it's just going to chew up IOPS

Jim B
  • 24,081
  • 4
  • 36
  • 60