Solved

Exchange 2007 - Export to CSV shell command

Posted on 2013-06-21
5
585 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
  • 3
  • 2
5 Comments
 
LVL 12

Accepted Solution

by:
Julian123 earned 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Exchange 2010 error RBAC 3 15
No Exchange 2013 servers detected 3 29
exchange, outlook 8 57
Doubt. 2 56
We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
In this video we show how to create an Address List 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 Organization >> Ad…
This video discusses moving either the default database or any database to a new volume.

914 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now