Knowledge Base Home

Call Support


Search the Knowledge Base

Skip to end of metadata
Go to start of metadata

Environment

O365

Exchange 2013

Synopsis

How to Remove messages from Exchange in preparation for full re-injection

Solution

If you are a member of the "Mailbox Search" and “Mailbox Import Export” role group, you will have full access to the search-mailbox command-let in EWS.  By default, this powerful command-let allows the search of mailboxes, where results are sent to another mailbox.  The command-let is a major part of the E-discovery capability for Exchange in On Prem and O365.

The command-let has a very useful option to remove all content in a mailbox bypassing the RIF and RIF Purge folders allowing for immediate purge of all mailbox data.  The option comes in very handy when trying to test baseline injection performance metrics.  The basic command is.


Search-mailbox Alex –DeleteContent

 

To add user 3Plus_netmail to the Mailbox Search and Mailbox Import Export role so you have access to the command, use the following command.

New-ManagementRoleAssignment -User 3Plus_netmail -Role "Mailbox Search" "Mailbox Import Export"

Note: BTW these roles are not assigned to any account by default.

 

For even more utility, use the commandlet with a csv file to DeleteContent from a group of test accounts listed in a CSV file.

Import-CSV "c:\del_mb_content.txt" | Foreach-Object{Search-mailbox -Identity $_.mb -DeleteContent -force:$True -Confirm:$false}

 

Where the del_mb_content file would contain...:

 

mb,

user1

user2

user3

Notes

For more information on the search-mailbox command-let please see http://help.outlook.com/en-us/140/gg315525.aspx .


Help us improve!
Is this article helpful?
Is it well written?
Is the content complete?

  • No labels