separate listing of emails with multiple recipients?

Welcome Forums General PowerShell Q&A separate listing of emails with multiple recipients?

This topic contains 0 replies, has 1 voice, and was last updated by  Forums Archives 7 years, 2 months ago.

  • Author
  • #5601

    Points: 0
    Rank: Member

    by Heine at 2013-02-27 02:20:19


    Does anyone know how I can get a list from the messagetrackinglog where an email send to multiple recipients is listed on separate lines with on recipient on each?

    I'm working with the following objects: |Select-object Timestamp, Sender, Recipients, MessageSubject |

    by poshoholic at 2013-02-27 07:20:53

    So you are reading the contents of the tracking log, and the Recipients property has a newline-delimited list of email addresses? If that's an accurate assessment, you could replace your Recipients property name above with this:
    @{Name='Recipients';Expression={@($_.Recipients -split "`r`n|`r|`n")}}
    That tells PowerShell to make the Recipients property of the selected object contain an array of the Recipients property you passed in, split on any newline character combination.

    by Heine at 2013-05-03 03:21:21

    Hi Kirk

    Thanks for the reply.

    I'm totally new to Powershell so unfortunately I don't think I understand your question.

    But let me try to elaborate a bit on my problem.

    I'm working with the below script and it returns the following to me:

    #TYPE Selected.Microsoft.Exchange.Management.TransportLogSearchTasks.MessageTrackingEvent
    "26-02-2013 09:09:49","SMTP","2","",""

    What I would like it to return is:

    #TYPE Selected.Microsoft.Exchange.Management.TransportLogSearchTasks.MessageTrackingEvent
    "26-02-2013 09:09:49","SMTP","2","",""
    "26-02-2013 09:09:49","SMTP","2","",""

    How should I do that ?

    $EmailDomainOne = "**"
    $EmailDomainTwo = "**"
    $startdate = "2/26/2013 9:00am"
    $enddate = "2/26/2013 11:00am"
    $outputfile = "test1.txt"

    get-messagetrackinglog -start $startdate -end $enddate -resultsize unlimited| where {(([string]$_.recipients -like $EmailDomainOne -and [string]$_.sender -like $EmailDomainTwo)) -and (($_.eventid -eq "SEND") )} | Select-object Timestamp, Source, RecipientCount,Sender, {$_.recipients} | Sort-Object -Property Timestamp| export-csv $outputfile -Encoding unicode

The topic ‘separate listing of emails with multiple recipients?’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort