Question

I have a client who wants to mine their MS Exchange data to capture all incoming e-mail addresses (and outgoing). Outlook isn't an option, and we tried Add a Contact but we need a different solution.

I know we can export all of the mailboxes smtp addresses - but we don't need that.. When a new e-mail comes in to a specific mailbox, we want to harvest it. Obviously we would only do it for specific users lest we bring the server to it's knees.

We don't want to use Outlook.. Rather, we want a server side solution, Powershell etc, that exports to a CSV for post processing purposes. And we don't want this to be a part of any archive process either (unless it doesn't actually complete an archive process - not my rules, the client's..)

Using exchange 2007 - but would rather move to 2010 etc..

Is there any way to export these external addresses via powershell to a csv file on a nightly, if not weekly basis, for specific or all mailboxes? (GUI is not an option either)...

Was it helpful?

Solution

You can just enable (by default it's done) message tracking on you server using Set-TransportServer (on Hub Transport server or Edge Transport server) or Set-MailboxServer (on Mailbox server) depending on the kind of server your are working on as explain in this Microsoft article.

Then you can have a look to C:\Program Files\Microsoft\Exchange Server\V14\TransportRoles\Logs\MessageTracking directory.

On the server side your can read this file as a CSV file using :

import-csv MSGTRK20130627-1.LOG -Header date-time,client-ip,client-hostname,server-ip,server-hostname,source-context,connector-id,source,event-id,internal-message-id,message-id,recipient-address,recipient-status,total-bytes,recipient-count,related-recipient-address,reference,message-subject,sender-address,return-path,message-info,directionality,tenant-id,original-client-ip,original-server-ip,custom-data

I just found the header in the forth line, and you must ignore the first four lines.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top