Using Export-Mailbox without including subfolders

Posted by AspNyc on Server Fault See other posts from Server Fault or by AspNyc
Published on 2010-02-24T16:39:36Z Indexed on 2010/04/13 14:43 UTC
Read the original article Hit count: 440

Filed under:
|

I want to delete a certain group of messages from somebody's mailbox. I already have the basic Powershell command ready to go:

Get-Mailbox -Identity jshmoe | Export-Mailbox -SubjectKeywords "VirusWarning" -IncludeFolders "\Inbox" -StartDate "02/24/2010" -DeleteContent

The problem is that Joe Shmoe's "Inbox" is huge, and I know the messages I want to delete are only in the main Inbox folder. However, the above Powershell command appears to crawl all subfolders beneath "Inbox". Is there a way to tell it not to?

© Server Fault or respective owner

Related posts about exchange2007

Related posts about powershell