无需CC即可获取消息跟踪日志

我试图找出如何跟踪一个接一个发送的电子邮件,而不需要任何组或用户只有一个收件人。

我有这个脚本,但显示所有电子邮件,包括CC,有什么我失踪?

$senders=Get-User -Organization xx | Where { $_.RecipientType -eq 'UserMailbox' -and $_.useraccountcontrol -notlike '*accountdisabled*'} Foreach($sender in $senders) { Get-MessageTrackingLog -Start (Get-Date).AddHours(-3) -ResultSize Unlimited -Sender $sender.WindowsEmailAddress |?{$_.RecipientStatus -notcontains "cc" -and $_.RecipientCount -eq '1' -and $_.sender -notlike '[email protected]' -and $_.Recipients -notlike "*@domain.com" } | select Sender,@{N="Receiver";E={$_.Recipients}},RecipientCount,Messagesubject,TimeStamp } 

您想要过滤的RecipientStatus似乎只包含在RECEIVE EventId

 ? {$_.EventId -eq "RECEIVE" -and $_.RecipientStatus -notcontains "cc" [... more code ...]