exchange 2010 message tracking, i want to exclude my domain for the results on incoming and outgoing

I tried the following commands with no success

get-messagetrackinglog -Recipient userX@domainx.com -Start “12/01/2017 12:01 AM” -End “12/07/2017 03:30 PM” -resultsize unlimited |  Where-object {$_.senders -notlike "*@domainx.com"} | select-object sender, timestamp, messagesubject, {$_.recipients} | export-csv “c:\export1.csv”

get-messagetrackinglog -Sender userX@domainx.com -Start “12/01/2017 12:01 AM” -End “12/07/2017 03:30 PM” -resultsize unlimited |  Where-object {$_.recipient -notlike "*@domainx.com"}  | select-object sender, timestamp, messagesubject, {$_.recipients}| export-csv “c:\export2.csv"
ColdnorthAsked:
Who is Participating?
 
Jose Gabriel Ortega CConnect With a Mentor CEO J0rt3g4 Consulting ServicesCommented:
Maybe you want to get the recipients not in your domain that are sending the user in sender. That would be something like this:


get-messagetrackinglog -sender UserX@domainX.com -Start "12/01/2017 12:01 AM" -End "12/07/2017 03:30 PM" -resultsize unli
mited | select * | where-object{ foreach($recp in $_.Recipients){ $recp -notmatch "domainX.com"}}

Open in new window

0
 
Jose Gabriel Ortega CCEO J0rt3g4 Consulting ServicesCommented:
You are filtering the senders using "UserX@domainX.com" but then you don't want anything with senders in your domain, that will bring nothing into it, because the -sender "userX@domainx.com" will always be true and in the where will always be false.
0
 
ColdnorthAuthor Commented:
Sweet!
That makes more sense

Thank you!
1
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.