Export-Mailbox sanity check
So i've been asked to export and then delete a specific message from a mailbox. The subject of the message is "Big Meeting Cancelled". In the powershell i run the following command: export-mailbox -identity "User Mailbox" -subjectkeywords "Big Meeting Cancelled" -targetmailbox "Administrator Mailbox" -targetfolder inbox When i ran the command it started exporting *everything* from the "User Mailbox" to the "Administrator Mailbox". My assumption was that it would only grab items with "Big Meeting Cancelled" in the subject line. What am i doing wrong?? If I had run the same command using the "-deletecontent" switch, would that have deleted *everything* from the source mailbox?
September 23rd, 2010 11:37am

Maybe its a command order issue? Try Export-Mailbox -TargetMailbox ExportMailbox -SubjectKeywords "Big Meeting Canceled" I would also check your spelling of the subject to ensure its an exact match. It shouldn't of course go rogue on you if you misspell, should just return no results but I always do a sanity check by copying the content from a sample message I know I should get. Yes it would have deleted anything it thought was a match to the export parameters If this doesn't work for you, you may want to check out Lucid8's DigiScope http://www.lucid8.com/product/digiscope.asp which is a bit more powerful, can open offline EDBs as well as production server stores etc. Troy Werelius Lucid8
Free Windows Admin Tool Kit Click here and download it now
September 23rd, 2010 12:04pm

Why would the order matter? If the command says 'SubjectKeywords "Big Meeting Cancelled"', it shouldn't matter where it is in that string. It sure sounds like "rogue" is what it did. Can anyone else shine some light on this?
September 23rd, 2010 12:11pm

You are correct of course that it shouldn't matter and maybe it doesnt but its worth a shot to see if it does IMO. Sometimes things like order matter even if they shouldn't Troy Werelius Lucid8
Free Windows Admin Tool Kit Click here and download it now
September 23rd, 2010 12:20pm

ok, i think i see what i did wrong.. nothing! i was confused because as soon as i executed the command i saw the target mailbox filling up with every message from the source mailbox, not just the one i was looking for. turns out this is by design... "Because Export-Mailbox first copies all content to the destination mailbox before performing the search the target mailbox can get quite large and will have a lot of IO. " it seems like an unwieldy way to perform the task, but so be it. too bad Microsoft doesn't mention this little tid bit on their site. thanks!
September 23rd, 2010 4:52pm

Wow I agree that this is a strange design and allot of overhead IMO. THanks for the update Troy Werelius Lucid8
Free Windows Admin Tool Kit Click here and download it now
September 23rd, 2010 4:56pm

On Thu, 23 Sep 2010 20:51:16 +0000, blinkyjesus wrote: > > >ok, i think i see what i did wrong.. nothing! i was confused because as soon as i executed the command i saw the target mailbox filling up with every message from the source mailbox, not just the one i was looking for. turns out this is by design... > > > >"Because Export-Mailbox first copies all content to the destination mailbox before performing the search the target mailbox can get quite large and will have a lot of IO. " > > > >it seems like an unwieldy way to perform the task, but so be it. too bad Microsoft doesn't mention this little tid bit on their site. It's necessary to do that so all the messages in the dumpster can be searched, too. Those messages aren't searchable. The only thing you can do with a message in the dumpster is to remove it or copy it to annother folder where it becomes just another normal message (one that can be read and searched). This changes in Exchange 2010. --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP
September 23rd, 2010 7:42pm

Good info thanks Rich. Still allot of overhead but good to know the reason they do this. Much appreciated Troy Werelius Lucid8
Free Windows Admin Tool Kit Click here and download it now
September 23rd, 2010 7:46pm

Is there some way to exclude the dumpster for the search?
September 24th, 2010 10:48am

On Fri, 24 Sep 2010 14:47:01 +0000, blinkyjesus wrote: >Is there some way to exclude the dumpster for the search? Not that I'm aware of. --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP
Free Windows Admin Tool Kit Click here and download it now
September 24th, 2010 10:15pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics