Report Number of Emails Recieved Externally per user in Distribution Group over month

140257-thumb_exchange_original[1]

# set Identity to distributiongroup alias
$distributiongroup = Get-DistributionGroup -Identity "#Distribution Group Name"
 
$groupmembers = Get-DistributionGroupMember -Identity $distributiongroup | Where-Object { $_.RecipientType -eq "UserMailbox" }
 
foreach ( $member in $groupmembers )
{
$intRec = 0
#Gets the SMTP Address of Mailbox
$smtp = Get-Mailbox -Identity $member.alias | Select -Property PrimarySmtpAddress
#Change Start and End Date where needed, Change source to STOREDRIV for Internal or remove where for all messages ( SMTP = External )
Get-TransportServer | Get-MessageTrackingLog -ResultSize Unlimited -Start “02/01/2015” -End “02/28/2015” -Recipients $smtp.PrimarySmtpAddress -EventID RECEIVE | where {$_.source -eq 'SMTP'} | 
 
ForEach { $intRec++ }
Write-Host "E-mails received from External Source by"$smtp.PrimarySmtpAddress "-" $intRec
 
}

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...