Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Search-Mailbox

Applies to: Exchange Server 2010

Topic Last Modified: 2011-03-19

Use the Search-Mailbox cmdlet to search a mailbox and copy the results to a specified target mailbox.


Search-Mailbox -Identity <MailboxIdParameter> [-Confirm [<SwitchParameter>]] [-DomainController <Fqdn>] [-DoNotIncludeArchive <SwitchParameter>] [-IncludeUnsearchableItems <SwitchParameter>] [-LogLevel <Suppress | Basic | Full>] [-SearchDumpster <SwitchParameter>] [-SearchQuery <String>] [-WhatIf [<SwitchParameter>]]


Search-Mailbox -Identity <MailboxIdParameter> -TargetMailbox <MailboxIdParameter> [-Confirm [<SwitchParameter>]] [-DomainController <Fqdn>] [-DoNotIncludeArchive <SwitchParameter>] [-IncludeUnsearchableItems <SwitchParameter>] [-LogLevel <Suppress | Basic | Full>] [-SearchDumpster <SwitchParameter>] [-SearchQuery <String>] [-TargetFolder <String>] [-WhatIf [<SwitchParameter>]]


Search-Mailbox -Identity <MailboxIdParameter> -EstimateResultOnly <SwitchParameter> [-Confirm [<SwitchParameter>]] [-DomainController <Fqdn>] [-DoNotIncludeArchive <SwitchParameter>] [-IncludeUnsearchableItems <SwitchParameter>] [-LogLevel <Suppress | Basic | Full>] [-SearchDumpster <SwitchParameter>] [-SearchQuery <String>] [-WhatIf [<SwitchParameter>]]

Parameter Required Type Description

EstimateResultOnly

Required

System.Management.Automation.SwitchParameter

The EstimateResultOnly switch specifies that only an estimate of the total number and size of messages returned by the search be provided. Messages aren't copied to the target mailbox. You can't use this switch with the TargetMailbox parameter.

Identity

Required

Microsoft.Exchange.Configuration.Tasks.MailboxIdParameter

The Identity parameter specifies the identity of the mailbox to search. You can use the following values:

  • Alias
  • Display name
  • Domain\Account
  • SMTP address
  • Distinguished name (DN)
  • Object GUID
  • User principal name (UPN)
  • LegacyExchangeDN

TargetMailbox

Required

Microsoft.Exchange.Configuration.Tasks.MailboxIdParameter

The TargetMailbox parameter specifies the identity of the destination mailbox where search results are copied. You can use the following values:

  • Alias
  • Display name
  • Domain\Account
  • SMTP address
  • DN
  • Object GUID
  • UPN
  • LegacyExchangeDN

You can't use this parameter with the EstimateResultOnly switch.

Confirm

Optional

System.Management.Automation.SwitchParameter

The Confirm switch causes the command to pause processing and requires you to acknowledge what the command will do before processing continues. You don't have to specify a value with the Confirm switch.

DomainController

Optional

Microsoft.Exchange.Data.Fqdn

The DomainController parameter specifies the fully qualified domain name (FQDN) of the domain controller that writes this configuration change to Active Directory.

DoNotIncludeArchive

Optional

System.Management.Automation.SwitchParameter

The DoNotIncludeArchive switch specifies that the user's archive mailbox shouldn't be included in the search. You don't need to specify a value for this switch.

IncludeUnsearchableItems

Optional

System.Management.Automation.SwitchParameter

The IncludeUnsearchableItems switch specifies whether to include items that couldn't be indexed by Exchange Search. When set to $true, the IncludeUnsearchableItems switch specifies that items that couldn't be indexed by Exchange Search should be included in the search results.

LogLevel

Optional

Microsoft.Exchange.Data.Storage.Infoworker.MailboxSearch.LoggingLevel

The LogLevel parameter specifies the logging level for the search. It can have one of the following values:

  • Suppress   No logs are kept.
  • Basic   Basic information about the query and who ran it is kept.
  • Full   In addition to the information kept by the Basic log level, the Full log level adds a complete list of search results.

SearchDumpster

Optional

System.Management.Automation.SwitchParameter

The SearchDumpster parameter specifies whether to search the Recoverable Items folder, which is the storage location in which items deleted from the Deleted Items folder are located until they're purged from the mailbox database.

SearchQuery

Optional

System.String

The SearchQuery parameter specifies a search string or a query formatted using Advanced Query Syntax (AQS).

If this parameter is empty, all messages are returned.

TargetFolder

Optional

System.String

The TargetFolder parameter specifies a folder name to save search results in the mailbox specified in the TargetMailbox parameter.

WhatIf

Optional

System.Management.Automation.SwitchParameter

The WhatIf switch instructs the command to simulate the actions that it would take on the object. By using the WhatIf switch, you can view what changes would occur without having to apply any of those changes. You don't have to specify a value with the WhatIf switch.

You need to be assigned permissions before you can run this cmdlet. Although all parameters for this cmdlet are listed in this topic, you may not have access to some parameters if they're not included in the permissions assigned to you. To see what permissions you need, see the "Discovery" entry in the Messaging Policy and Compliance Permissions topic.

Error Description

 

 

This example searches the mailbox of Joe Healy and copies the search results to the DiscoveryMailbox in the folder JoeHealy-ProjectHamilton.

Search-Mailbox -Identity "Joe Healy" -SearchQuery "Subject:Project Hamilton" -TargetMailbox "DiscoveryMailbox" -TargetFolder "JoeHealy-ProjectHamilton" -LogLevel Full 
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.