Exchange Email Clean

Hi All,
    Our client has sold a part of the business and now need to extract private business email from related accounts before handing over PST files. for example:

Email account: Manager@SoldDomain.com
Remove email from the following addresses:
Email Address: Director@domain.com
Email Address: FD@domain.com
Email Address: owner@domain.com

We need to ensure that no information (or as little as possible) from the other internal sectors are not passed over to the new company.

We are using Exchange 2010 at the moment.

Thanks,
LVL 5
ncomperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AmitIT ArchitectCommented:
You can use search-mailbox command. Refer:
https://technet.microsoft.com/en-us/library/dd298173(v=exchg.160).aspx

Check the example and customize it as per your requirement.
Jason CrawfordTransport NinjaCommented:
You can use Search-Mailbox as Amit suggested; however, your options with this method are to either copy the email found during the search to a separate mailbox or delete them.  If you decide to use Search-Mailbox, I think your best bet will be to do something like this (using the manager@solddomain.com example):

1. Export the manager@solddomain.com mailbox to a .pst file and save as a backup
2. Run the following command to optionally estimate search results:

Get-Mailbox manager@solddomain.com | Search-Mailbox -SearchQuery {From:"Director@domain.com" OR From:"FD@domain.com" OR From:"owner@domain.com"} -EstimateResultsOnly

Open in new window

3. If you are satisfied with the results, you can then run the following command to delete the email found during the search:

Get-Mailbox manager@solddomain.com | Search-Mailbox -SearchQuery {From:"Director@domain.com" OR From:"FD@domain.com" OR From:"owner@domain.com"} -DeleteContent

Open in new window

Your only other option other than the Search-Mailbox cmdlet is to use Outlook while connected to the manager@solddomain.com mailbox.  Keep in mind Outlook uses Advanced Query Syntax to search for email:

https://msdn.microsoft.com/en-us/library/aa965711%28v=vs.85%29.aspx

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ncomperAuthor Commented:
Thanks Guys,
  Thought it would be that easy. Ill have a try and post back with any questions
AmitIT ArchitectCommented:
Just remember PS command is not reversible. Once data is deleted there is no way to recover until  you have old backup. I suggest you to pipe it to target folder. In case you are not sure. So, you can recover emails easily in case it is needed.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.