Wednesday, July 3, 2013

How to remove a mail of mailbox database from server end


User R2 sends an email to a set of people with the subject line “I Love you. Now, Stallone being the IT manager wants you to delete that email from the server side.

All you gotta do is to run this cmdlet:

Get-Mailbox -Server EXCH | Export-Mailbox -TargetMailbox TempMailbox -TargetFolder ” To Delete” -SenderKeywords R2@E2Esolultions.com -SubjectKeywords ” I Love You ” –StartDate “07/03/13″ –EndDate “07/04/13″ -ExcludeFolders “\Calendar”, “\Contacts”, “\Deleted Items” –DeleteContent –MaxThreads 10

Terms
* Server name is EXCH
* Data will be extracted from user mailboxes to the folder “To Delete” in a mailbox called TempMailbox
* Start date and End Date switch let you choose a date range
* Set the ExcludeFolders switch if you don’t want to search specific folders
* DeleteContent is the switch which deletes the email
* MaxThreads is to specify 10 mailboxes will be processed at a time

Now remember that Export-Mailbox first copies content to the destination mailbox before performing the search and the target mailbox can get quite large and create heavy IO. This is different from creating a transport rule to filter incoming messages.

Users can still use the “Recall” option in outlook.




No comments:

Post a Comment