Skip to content

Commit c8dec33

Browse files
authored
Merge pull request MicrosoftDocs#4246 from MicrosoftDocs/chrisda
Chrisda to Master
2 parents ccffe45 + e876e3d commit c8dec33

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

exchange/exchange-ps/exchange/mailboxes/Search-Mailbox.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ monikerRange: "exchserver-ps-2010 || exchserver-ps-2013 || exchserver-ps-2016 ||
1414
## SYNOPSIS
1515
This cmdlet is available in on-premises Exchange and in the cloud-based service. Some parameters and settings may be exclusive to one environment or the other.
1616

17+
**Note**: By default, Search-Mailbox is available only in the Mailbox Search or Mailbox Import Export roles, and these roles aren't assigned to *any* role groups. To use this cmdlet, you need to add one or both of the roles to a role group (for example, the Organization Management role group). Only the Mailbox Import Export role gives you access to the DeleteContent parameter. For more information about adding roles to role groups, see [Add a role to a role group](https://docs.microsoft.com/Exchange/permissions/role-groups#add-a-role-to-a-role-group).
18+
1719
Use the Search-Mailbox cmdlet to search a mailbox and copy the results to a specified target mailbox, delete messages from the source mailbox, or both.
1820

1921
**Note**: In cloud-based environments, the Search-Mailbox cmdlet is being deprecated in favor of [New-ComplianceSearch](https://docs.microsoft.com/powershell/module/exchange/policy-and-compliance-content-search/new-compliancesearch) and related eDiscovery cmdlets.
@@ -22,10 +24,11 @@ For information about the parameter sets in the Syntax section below, see Exchan
2224

2325
## SYNTAX
2426

25-
### EstimateResult
27+
### Identity
2628
```
27-
Search-Mailbox [-Identity] <MailboxOrMailUserIdParameter> [-EstimateResultOnly]
29+
Search-Mailbox [-Identity] <MailboxOrMailUserIdParameter>
2830
[-Confirm]
31+
[-DeleteContent]
2932
[-DomainController <Fqdn>]
3033
[-DoNotIncludeArchive]
3134
[-Force]
@@ -36,32 +39,31 @@ Search-Mailbox [-Identity] <MailboxOrMailUserIdParameter> [-EstimateResultOnly]
3639
[-WhatIf] [<CommonParameters>]
3740
```
3841

39-
### Mailbox
42+
### EstimateResult
4043
```
41-
Search-Mailbox [-Identity] <MailboxOrMailUserIdParameter> -TargetFolder <String> -TargetMailbox <MailboxIdParameter>
44+
Search-Mailbox [-Identity] <MailboxOrMailUserIdParameter> [-EstimateResultOnly]
4245
[-Confirm]
43-
[-DeleteContent]
4446
[-DomainController <Fqdn>]
4547
[-DoNotIncludeArchive]
4648
[-Force]
4749
[-IncludeUnsearchableItems]
48-
[-LogLevel <Suppress | Basic | Full>]
49-
[-LogOnly]
5050
[-SearchDumpster]
5151
[-SearchDumpsterOnly]
5252
[-SearchQuery <String>]
5353
[-WhatIf] [<CommonParameters>]
5454
```
5555

56-
### Identity
56+
### Mailbox
5757
```
58-
Search-Mailbox [-Identity] <MailboxOrMailUserIdParameter>
58+
Search-Mailbox [-Identity] <MailboxOrMailUserIdParameter> -TargetFolder <String> -TargetMailbox <MailboxIdParameter>
5959
[-Confirm]
6060
[-DeleteContent]
6161
[-DomainController <Fqdn>]
6262
[-DoNotIncludeArchive]
6363
[-Force]
6464
[-IncludeUnsearchableItems]
65+
[-LogLevel <LoggingLevel>]
66+
[-LogOnly]
6567
[-SearchDumpster]
6668
[-SearchDumpsterOnly]
6769
[-SearchQuery <String>]
@@ -79,10 +81,6 @@ You can use the Search-Mailbox cmdlet to search messages in a specified mailbox
7981

8082
- Clean up the Recoverable Items folder for a mailbox when it has reached the Recoverable Items hard quota.
8183

82-
You need to be assigned permissions before you can run this cmdlet. Although this topic lists all parameters for the cmdlet, you may not have access to some parameters if they're not included in the permissions assigned to you. To find the permissions required to run any cmdlet or parameter in your organization, see Find the permissions required to run any Exchange cmdlet (https://technet.microsoft.com/library/mt432940.aspx).
83-
84-
**Note**: By default, Search-Mailbox is available only in the Mailbox Search or Mailbox Import Export roles, and these roles aren't assigned to *any* role groups. To use this cmdlet, you need to add one or both of the roles to a role group (for example, the Organization Management role group). Only the Mailbox Import Export role gives you access to the DeleteContent parameter. For more information about adding roles to role groups, see the "Add a role to a role group" section in [Manage role groups](https://technet.microsoft.com/library/jj657480.aspx).
85-
8684
## EXAMPLES
8785

8886
### -------------------------- Example 1 --------------------------
@@ -237,9 +235,11 @@ Accept wildcard characters: False
237235
```
238236
239237
### -DeleteContent
240-
The DeleteContent switch specifies that the messages returned by the search be permanently deleted from the source mailbox. When used with the TargetMailbox parameter, messages are copied to the target mailbox and removed from the source mailbox. If you set the logging level for the search to Basic or Full, you must specify a target mailbox and a target folder to place the log in. To delete messages from the source mailbox without copying them to the target mailbox, don't specify the TargetMailbox, TargetFolder, and LogLevel parameters.
238+
**Note**: You need to be assigned the Mailbox Import Export management role to use this switch. By default, this role isn't assigned to any role group (including Organization Management). Typically, you assign a role to a built-in or custom role group.
239+
240+
The DeleteContent switch specifies that the messages returned by the search be permanently deleted from the source mailbox. You don't need to specify a value with this switch.
241241
242-
You need to be assigned the Mailbox Import Export management role to use this switch. By default, this role isn't assigned to any role group. Typically, you assign a role to a built-in or custom role group. Or you can assign a role to a user, or a universal security group.
242+
When you use this switch with the TargetMailbox parameter, messages are copied to the target mailbox and removed from the source mailbox. If you set the logging level for the search to Basic or Full, you must specify a target mailbox and a target folder to place the log in. To delete messages from the source mailbox without copying them to the target mailbox, don't specify the TargetMailbox, TargetFolder, and LogLevel parameters.
243243
244244
Before you use the DeleteContent switch to delete content, we recommend that you test search parameters by using the LogOnly parameter, as shown in Example 2.
245245
@@ -331,7 +331,7 @@ The LogLevel parameter specifies the logging level for the search. It can have o
331331
The default log level is Basic.
332332
333333
```yaml
334-
Type: Suppress | Basic | Full
334+
Type: LoggingLevel
335335
Parameter Sets: Mailbox
336336
Aliases:
337337
Applicable: Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Online

0 commit comments

Comments
 (0)