Exchange 2007 Query


I need to query a specific mailbox in Exchange 2007.  I need to go back one month and retrieve the header information for all emails from and to this user, and export it to a CSV.  Something like:

Date | From | To | Subject

I imagine this is possible using PowerShell, but that is not my forte.  Any help would be greatly appreciated.

Thank you!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I assume it would have to be something like this:

1. List mails from specific user
Get-TransportServer  | Get-MessageTrackinglog -Start "mm/dd/yyy 00:00:00" -Sender "" | Select TimeStamp,Sender,Recipients,MessageSubject |Export-Csv "C:\Path\To\file.csv"

2. List mails sent to specific user
Get-TransportServer  | Get-MessageTrackinglog -Start "mm/dd/yyy 00:00:00" -Recipients "" | Select TimeStamp,Sender,Recipients,MessageSubject |Export-Csv "C:\Path\To\file.csv"

What these commands do is listing all existing HubTransport Servers in your Exchange Organization, and query them for the information you specify.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TropicalBoundAuthor Commented:

Thank you very much!  This is almost perfect, except that all the recipients come back as "System.String[]".  Have I entered something incorrectly?
TropicalBoundAuthor Commented:
OK.  Got it.  I had to change 'Recipients' to {$_.Recipients}

Thanks again jparedis!
TropicalBoundAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2003

From novice to tech pro — start learning today.