Total Sent Messages For Bulk Users Exchange 2016 RRS feed

  • Question

  • Hey Everyone - 

    I need some help with getting the number of messages from a list of users in a CSV. I only need the count in the past 30 days. Here is what I have I just can't figure out how to select the Name,Count values.

    $data = import-csv "c:\My Scripts\senders.csv"

    foreach ($i in $data)

      { $sender = $i.mailbox;

        Get-TransportService | Get-MessageTrackingLog -ResultSize Unlimited -Sender $sender -EventID Send -Start (Get-Date).AddDays(-30) -End (Get-Date) | Measure-Object | Select-Object Name,Count | Export-CSV c:\tmp\external_mailbox.csv -NoTypeInformation

    Thanks for any help provided

    • Moved by Bill_Stewart Wednesday, May 9, 2018 2:51 PM Abandoned
    Thursday, March 22, 2018 10:33 PM

All replies

  • Something like this should do the trick I think:
    $data = Import-Csv "c:\My Scripts\senders.csv"
    $List = foreach ($i in $data) {
        $Count = (Get-TransportService | 
            Get-MessageTrackingLog -ResultSize Unlimited -Sender $i.mailbox -EventID Send -Start (Get-Date).AddDays(-30) -End (Get-Date) |
            Name = $i.mailbox
            Count = $count
    $List | Export-CSV c:\tmp\external_mailbox.csv -NoTypeInformation

    Best regards,


    Friday, March 23, 2018 10:57 AM
  • Thanks a lot!! That did the trick
    Friday, March 23, 2018 4:34 PM