Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
add comment

2 Answers

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
share|improve this answer
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

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