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

Popular posts from this blog

Error: 0x80073701 when trying to add Print Services Role in Windows 2012 Standard

Disconnecting from a Windows Server 2012 R2 file sharing session on a Windows 7,8,10 machine

Windows 2016 RDS event 1306 Connection Broker Client failed to redirect the user... Error: NULL