REPORT EXCH 2007
Hello,
I am using Exchange 2007 and want export aGet-MessageTrackingLog to csv file. Before I gave that below try (which does not work at all..) I was adding -enc ASCII -width 1500 to be sure I had the entire subject field as I need the export by row not
list or fl.
--> could you please help me out to extract the data?
$start=(get-date).adddays(-7).toshortdatestring()
$end=(get-date).toshortdatestring()
Get-MessageTrackingLog -ResultSize Unlimited -Start $start -End $end | where {$_.Sender -like "*@domain.com"}| ft Timestamp,MessageSubject,Recipients,Sender
$file = "$($start.replace('/','_'))_to_$($end.replace('/','_')).csv"
$exportfilepath = export-csv D:\Report\TRY\$file -notypeinformation
February 11th, 2011 4:42pm
You were pretty close, you just cant use "FT" before you export to csv, you have to use the "select" option instead. "ft" and "fl" are for within the shell only. Store the data as a variable then pipe it to the export-csv
$start=(get-date).adddays(-7).toshortdatestring()
$end=(get-date).toshortdatestring()
$exportfilepath = Get-MessageTrackingLog -ResultSize Unlimited -Start $start -End $end | where {$_.Sender -like "*@domain.com"}| select Timestamp,MessageSubject,Recipients,Sender
$file = "$($start.replace('/','_'))_to_$($end.replace('/','_')).csv"
$exportfilepath | export-csv D:\Report\TRY\$file -notypeinformation
DJ Grijalva | MCITP: EMA 2007/2010 | www.persistentcerebro.com
Free Windows Admin Tool Kit Click here and download it now
March 21st, 2011 10:45am
Have a look of below blog also, it can help you bit more.
http://www.simple-talk.com/sysadmin/exchange/message-tracking-in-exchange-2007/
Anil
March 21st, 2011 12:43pm