$mailboxs = Get-Mailbox -server Mail

'Name;PrimarySmtpAddress;Received;Sent' > mbald.csv

foreach ($mailbox in $mailboxs)

{

  $received = Get-TransportServer | Get-MessageTrackingLog -ResultSize unlimited -Start (Get-Date).AddDays(-7) -End (Get-Date) -EventId "RECEIVE" -Recipients $mailbox.PrimarySmtpAddress | Measure-Object

  $sent = Get-TransportServer | Get-MessageTrackingLog -ResultSize unlimited -Start (Get-Date).AddDays(-1) -End (Get-Date) -EventId "RECEIVE" -Sender $mailbox.PrimarySmtpAddress | Measure-Object

  '"' + $mailbox.name + '";"' + $mailbox.PrimarySmtpAddress + '";"'+ $received.count + '";"'+ $sent.count + '"' >> mbald.csv

}