PowerShell ยป Mailbox Content Search

PowerShell scripts for Microsoft 365

Get mailbox search reports using PowerShell

Cmdlet: Get-MailboxSearch

Description: The Get-MailboxSearch cmdlet retrieves all the mailbox searches (In-Place/eDiscovery searches) that are in progress, complete or stopped.

About mailbox search

In Exchange Online, the mailbox search feature is used to perform an In-Place or eDiscovery search. The Get-MailboxSearch cmdlet can be used to retrieve details of either type of mailbox search.

Important:

On the other hand, it is important to note that the results retrieved by Get-MailboxSearch are the mailbox searches created using the New-MailboxSearch cmdlet. However, from May 2020, Microsoft 365 will remove the support for New-MailboxSearch cmdlet, which renders the results of Get-MailboxSearch cmdlet useless. It cannot provide details on the latest mailbox searches.

Below are some scripts that use Get-MailboxSearch for your reference:
  1.  Get-MailboxSearch
  2.  [[-Identity] <SearchObjectIdParameter>]
  3.   [-ResultSize <Unlimited>]
  4.   [<CommonParameters>]

Example 1:

1  Get-MailboxSearch -ResultSize "unlimited"

This script retrieves a list of all mailbox searches.

 

Example 2:

1  Get-MailboxSearch "Project Pleasanton" | Format-List

This script retrieves all properties for the mailbox search Project Pleasanton.

 

Example 3:

1  (Get-Mailbox Mark).InPlaceHolds; Get-MailboxSearch -InPlaceHoldIdentity 9953d0f0fd03415e949d4b41c5a28cbb

This script retrieves the In-Place Holds that a user is placed on. The first command shows GUIDs of In-Place Holds. The last command retrieves a mailbox search based on the GUID of the In-Place Hold that the user is placed on.

Microsoft 365 mailbox search with M365 Manager Plus

With M365 Manager Plus you don't have to worry about the validity of the PowerShell cmdlets. The In-Place Hold & eDiscovery Activity report provides all the audit details of all the In-Place and eDiscovery searches done by admins in your Microsoft 365 setup.

 

Inplace Hold Activity Report

Go to the Reports tab.

  1. Go to the Reports tab.
  2. Navigate to Other Services > Security Reports in the left pane.
  3. Under Admin Activities Reports, click on InPlace Hold & eDiscovery Activity.

Read more about security reports here.