Get-MessageTrackingLog shows System.String[] instead of recipients
I am using the Get-MessageTrackingLog and Export-CSV PowerShell cmdlets to provide a report on messages sent to specific recipients. This is the command I am issuing:
Get-MessageTrackingLog -Sender “user@mydomain.com” -Server “myserver” -Start “02/24/2016 00:00:00” -End “02/24/2016 10:00:00” -ResultSize Unlimited -EventID Send | Select TimeStamp,Sender,MessageSubject,Recipients | Export-CSV “C:\export.csv” -NoType
However, the recipients column shows “System.String[]” instead of the actual recipients. This is because they are a collection of objects and the easiest way to fix this is to put the column names in between curly brackets:
Get-MessageTrackingLog -Sender “user@mydomain.com” -Server “myserver” -Start “02/24/2016 00:00:00” -End “02/24/2016 10:00:00” -ResultSize Unlimited -EventID Send | Select {$_.TimeStamp},{$_.Sender},{$_.MessageSubject},{$_.Recipients} | Export-CSV “C:\export.csv” -NoType