Undo PST import - Exchange 2010. Delete from mailbox anything present in .pst file.

A user was provided a .pst export of a former employee for review.  Instead of opening the .pst (9GB) she imported it into her own mailbox.  I now need to remove all of those items from the mailbox.  

I was thinking of deleting everything which was added from Outlook from the moment she performed the import (not sure if this is possible).  

I am looking for the correct powershell command, possibly a new-mailboxexportrequest with -deletecontent.  I would need help with the where clause to select just the emails imported from that other mailbox.  Open to other ideas.

Every folder was imported, drafts, deleted items, etc. etc.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

Gary DewrellSenior Network AdministratorCommented:
You can use the -DeleteContent switch with Export-Mailbox assuming you can find something unique to filter on like the orginal users in the To Field or a date range etc.

Lots of possible options. Take a look at the blog post that will show you how to do this.

There is no way to undo. It has to be done manually.  Do you use and Exchange server and have previous day backup?

If so, with the current Outlook simply blow out or delete anything before today so only today's email remain then restore her emails up to yesterday from backup.  You still need a PS script to check and delete empty folders.  Then add the ex employee's pst as an additional data file.

Here are some PS scripts you can use to delete empty folders: https://social.technet.microsoft.com/forums/scriptcenter/en-US/8210b3a0-9605-446c-8e84-b68e5ae01e38/powershell-checking-for-empty-folders-and-deleting

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
YMartinAuthor Commented:
Thanks.  It looks like there is no single field I can use for this.  Was hoping there was a date_created or something like that which would help me to isolate the newly imported stuff but not finding anything.  Just sent and received dates.  For contacts I can use date modified but for the calendar I am not finding anything.  

A restore would be one option but I would need to export the valid stuff between now and the restore date excluding the imported stuff so we would be back to the same search problem (export only the users original stuff).  This would be a lot easier though to just export incoming and outgoing mail from the current mailbox for the past 2 days.

I am thinking it will be easier after all to use Outlook to delete the items one folder at a time comparing to the .pst where necessary.
YMartinAuthor Commented:
Thanks for your help.
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

From novice to tech pro — start learning today.