Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Exchange 2007 - Export to CSV shell command

Posted on 2013-06-21
5
Medium Priority
?
596 Views
Last Modified: 2013-06-24
Each mailbox has emails that are tagged with a phrase "This message has been automatically saved and archived". I need to find the number of emails for every mailbox and export that to and .csv file. In the end, I would like to have a .csv file with the mailbox account and the number of messages that matches the phrase.

What command can I use in shell to achieve this?
0
Comment
Question by:namido
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 12

Accepted Solution

by:
Julian123 earned 1500 total points
ID: 39267066
There is no one single command that will give you what you need, but you can get it with a combination of a few. Here's how I would do it:

1. Create a new mailbox.
2. Use the export-mailbox command on each mailbox and configure it to filter based on the phrase you want. You can run the sun multiple mailboxes using get-mailbox | export-mailbox. The exact syntax for the command can be found here: http://technet.microsoft.com/en-us/library/aa998579(v=EXCHG.80).aspx. The results will be that a copy of each of those items will be made in the new mailbox.
3. Run the get-mailboxstatistics command on the new mailbox. That will give you count of all items in the mailbox. Since the only items you've placed there are those you copied in the previous step, that count should match the number of items you found.
0
 

Author Comment

by:namido
ID: 39267251
Will this separate each mailbox? It looks like the get-mailboxstatistics will only give me results from the new mailbox created.
0
 
LVL 12

Expert Comment

by:Julian123
ID: 39267269
If you need that, you can use export-mailbox to put items in separate folders in #2 above. You can then run get-mailboxFOLDERstatistics to get the per-folder account in #3.
0
 

Author Comment

by:namido
ID: 39267353
Could you give me an example of the syntax you would use? Catching and separating the mailbox and phrase is what I'm struggling with.
0
 
LVL 12

Expert Comment

by:Julian123
ID: 39267373
Here's an example:

Export-Mailbox -Identity contoso\john -TargetMailbox MyMailbox -TargetFolder MyData -ContentKeywords "mykeyword"

Full details here: http://technet.microsoft.com/en-us/library/aa998579(v=EXCHG.80).aspx
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The core idea of this article is to make you acquainted with the best way in which you can export Exchange mailbox to PST format.
If something goes wrong with Exchange, your IT resources are in trouble.All Exchange server migration processes are not designed to be identical and though migrating email from on-premises Exchange mailbox to Cloud’s Office 365 is relatively simple…
To show how to create a transport rule in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Rules tab.:  To cr…
This video discusses moving either the default database or any database to a new volume.

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question