Emails sent report - Exclude self domain
hi all,
can me generating emails sent report user ? report should not include self domain.
example : suppose id atul@abcd.com if generating report myself report should not list other ids of abcd.com should show external ids , not own domains mail ids
i running below command , not helping - listing other ids of abcd.com (internal communication)
get-transportserver | get-messagetrackinglog -resultsize unlimited -sender: atul@abcd.com -start "12/01/2016" -end "12/31/2016"| select timestamp,eventid,recipients,messagesubject >c:\emailstat_report\atul.csv
-atul
theatula
hi atul,
you'd adding filter pipeline. filter should allow messages through contain @ least 1 foreign domain among recipients.
get-transportserver | get-messagetrackinglog -resultsize unlimited -sender: atul@abcd.com -start "12/01/2016" -end "12/31/2016" | where-object { $_.recipients | where-object { $_ -notlike "*@abcd.com" }} | select timestamp,eventid,recipients,messagesubject | export-csv c:\emailstat_report\atul.csv
cheers,
fred
note: see how replaced redirect export-csv @ end? it's better way generate csv.
there's no place 127.0.0.1
Windows Server > Windows PowerShell
Comments
Post a Comment