Abstract: On some Exchange environments you might to disable the content indexing, but didn´t wish to perform that on every DB by hand, so you need a script

The following script:

# Tested on Exchange 2016

CLS
Write-Host "This script disabled the MS Search Index on all DBs on a given Exchange DAG"
Write-Host "...Working ... Please wait... collecting mail DBs..."

$ExMailBoxes = Get-MailboxDatabase | where {$_.MasterServerOrAvailabilityGroup -eq "EXCHDAG01"}

foreach ($MailBox in $ExMailBoxes)
{

        Write-Host "-------------------------------------------------------"  -foregroundcolor green

       
        if ($Mailbox.IndexEnabled -eq "true")
        {
       
            Write-Host "Will disable index for:"$Mailbox.Name
           
            # https://technet.microsoft.com/en-us/library/aa996416(v=exchg.150).aspx
            Set-MailboxDatabase -Identity $Mailbox.Name -IndexEnabled $false
        }
        else
        {
            Write-Host "Index already disabled for:"$Mailbox.Name
        }

        Write-Host "-------------------------------------------------------"  -foregroundcolor green
       
}

Will disable the content indexing on all Exchange mail DBs on an Exchange DAG with the name EXCHDAG01 if it is still enabled. According to the technet article here, disabling Exchange Search impacts the functionality and performance of the full-text searches that are performed by your users using Outlook in online mode or on Windows mobile devices. But if you use Outlook Cache mode, the local indexing is used, rather then the on the server (so you might not need it here). In-Place eDiscovery also relies on Exchange Search. If you disable Exchange Search for a mailbox database or for a Mailbox server, In-Place eDiscovery searches won`t return any messages from the database or server.

 

Note:

This could be used if you see that the noderunner.exe takes a very high amount of CPU. Then you can disable the content indexing and enable it only on the DBs where you need it.

Comments (0)

There are no comments posted here yet

Leave your comments

Posting comment as a guest.
Attachments (0 / 3)
Share Your Location