Solved

Exchange 2007 - Export to CSV shell command

Posted on 2013-06-21
5
584 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Getting certificate error in Outlook 1 21
MX Backup 4 39
Exchange 2013 Errors 2 20
EXCHANGE: Extended schema in child domain 7 0
Resolve DNS query failed errors for Exchange
Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

757 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

23 Experts available now in Live!

Get 1:1 Help Now