Solved

Exchange 2007 - Export to CSV shell command

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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Exchange 2013 certificate error 3 33
OWA issue - Exchange 2013 - 440 Login Timeout 8 37
Creating DAG on Exchange 2016 4 16
Exchange2013 MAPI 6 13
This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
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…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

809 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