Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1227
  • Last Modified:

Delete content of mailboxes


We have splitted away from our parent company which hosted our former mailboxes under our old e-mail address domain (e.g. olddomain.com). During a period of time, we have an e-mail forwarding from olddomain.com to newdomain.com.
However, as this forwarding is already in effect and we have migrated the content of the mailboxes we wish to delete the content of these mailboxes.

How can we do this centrally in a easy and effective way?

It's important that we do not delete the e-mail forwarding (which is done by "Mail flow"), but only the data (e-mails, calendar and contacts).
  • 2
1 Solution
To summarise,

First run the following 2 commands:
New-RoleGroup -Name "Exchange Mailbox Import Export" -Roles "Mailbox Import Export" -Members "domain\username" -DisplayName "Exchange Mailbox Import Export" -Description "This group will provide access to mailbox import and export cmdlets within entire Exchange Organization."

New-RoleGroup -Name "Exchange Support Diagnostics" -Roles "Support Diagnostics" -Members "domain\username" -DisplayName "Exchange Support Diagnostics" -Description "This group will provide access to support diagnostics cmdlets within entire Exchange Organization."

(replace "domain\username" with the user that will be carrying out the task.)

Close and reopen EMS to ensure the search-mailbox cmdlet is loaded.
Finally, run:
get-mailbox | search-mailbox -deletecontent -force
jeliassonAuthor Commented:
Thank you very much!

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now