MSExchangeGuru.com

Learn Exchange the Guru way !!!

 

Remove one email from Exchange 2007

I just thought of sharing a cmdlet which every exchange pro should have handy.

User Arnold sends an email to a set of people with the subject line “I am back”. 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 arnold@terminator.com -SubjectKeywords ” I am back ” –StartDate “12/30/10″ –EndDate “12/31/10″ -ExcludeFolders “\Calendar”, “\Contacts”, “\Deleted Items” –DeleteContent –MaxThreads 10

 

Conditions:

  • 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.

-
Ratish Nair
MVP Exchange
Team@ MSExchangeGuru

KeyWords: Delete one email from Exchange, delete one email from all mailboxes, cmdlet to delete one emails from mailboxes, how to delete one email message in exchange, Powershell command to delete one email in exchange 2007.

4 Responses to “Remove one email from Exchange 2007”

  1. Scott R Says:

    Pretty cool one !! Ive made a note of it….

    Scott

  2. Hitesh Soni Says:

    its very nice, as one administrator it is must to know with prectical

  3. Salman Says:

    Cool one. however, i am having problem with above command ExportMailbox:string missing???

    any help plzzz….

  4. mohamed kalim ansari Says:

    Dear Ratish Nair Sir.

    Sir. we need, how to delete a specific mail message from all exchange server 2007 mailbox user users.

    Please can you tell me complete Processor step by step.

    Thanks Regard.

Leave a Reply

Notify me of followup comments via e-mail. You can also subscribe without commenting.