Friday, March 20, 2015

Exchange 2010 How to re-index mailbox database

 Note: Do the below if it happens all users on the DB. If just for one user, move the user to other DB to see if the issue is gone.

Exchange 2010 re-index mailbox database
Users may report that searching Outlook for non-cached or online mode mailboxes isn't getting the right results or not returning results past a certain date. Also OWA may return "The action couldn't be completed.  Try again later." when trying to search. You need to reindex your mailbox database(s). 
1. Run Repair-ExchangeSearchSymLinks.ps1. It isn't included in the normal scripts folder under the Exchange program files, you can copy this to a text document and save it as Repair-ExchangeSearchSymLinks.ps1.
01write-host "Attempting to repair symbolic links"
02 
03write-host "Stopping msftesql-exchange and msexchangesearch services"
04stop-service -Force msexchangesearch
05stop-service -Force msftesql-exchange
06 
07$rval = get-PSSnapin -Name Microsoft.Exchange.Management.PowerShell.Setup -ea SilentlyContinue
08if(!$rval)
09{
10 add-PSSnapin -Name Microsoft.Exchange.Management.PowerShell.Setup -ea SilentlyContinue
11}
12 
13write-host "Installing symbolic links"
14Install-ContentIndexingService –HubOnlyFilterRegistration
15 
16if(!$rval)
17{
18 Remove-PSSnapin -Name Microsoft.Exchange.Management.PowerShell.Setup -ea SilentlyContinue
19}
20 
21write-host "Starting msftesql-exchange and msexchangesearch services"
22start-service msexchangesearch
23start-service msftesql-exchange
24 
25write-host "Symbolic links restored."
26write-host "Please run test-exchangesearch to verify installation."
Or you can get it from Microsoft here if you don't trust me and place it in the Exchange Server\V14\Scripts folder. Open Exchange Management Shell (remember you might need to run EMS elevated and run Set-ExecutionPolicy Unrestricted first), change path to the scripts folder then run:
.\Repair-ExchangeSearchSymLinks.ps1
 
2. Next run the ResetSearchIndex.ps1 script, this one is included in the Exchange program files scripts folder so no need to download. You can run it against a specific database or against all of them as per the commands below:

.\ResetSearchIndex.ps1 -All    .\ResetSearchIndex.ps1 databasename
 
You should see event id 109 for each database stating that an index has been created and sometime later event id 110 for each database as the indexing finishes.

1 comment:

  1. How *LONG* do these scripts take to run, and do they affect the Users' ability to send & receive E-mails & work Calendars while they do?

    ReplyDelete