none
Query total daily message RRS feed

  • Question

  • we have a journal mailbox set for each mailbox database.  Enterprise Vault journaling is slow and the support is asking to create more journal mailboxes for the database.  But I'd like to get an inventory for daily total email volume in and out of all database. Any advice how to get that?  I found a script to inventory average mail volume per mailbox.  But like to see if there is one to get me the total.

    Thanks,

    Friday, November 15, 2019 12:09 AM

Answers

  • Hi,

    I am writing here to confirm with you how thing going now?

    If the above suggestion helps, please be free to mark it as an answer for helping more people.

    Regards,

    Kyle Xu


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    • Marked as answer by ChrisD0919 Friday, November 22, 2019 3:06 AM
    Wednesday, November 20, 2019 11:35 AM
    Moderator

All replies

  • Hi,

    This script will be useful to you:

    Before using this script, you need to modify the value of "Database"

    $From = "11/13/2019"
    $To = "11/15/2019"
    
    $intSent = 0
    $intSentSize = 0
    $intRec = 0
    $intRecSize = 0
    $Mailboxes = Get-Mailbox -ResultSize unlimited -Database "YourDatabse"  | where {$_.RecipientTypeDetails -eq "UserMailbox"}
    
    foreach ($Mailbox in $Mailboxes){
    Get-TransportService | Get-MessageTrackingLog -Sender $Mailbox.PrimarySmtpAddress -ResultSize Unlimited -Start $From -End $To | ForEach {
        If ($_.EventId -eq "RECEIVE" -and $_.Source -eq "SMTP") {
            $intSent ++
            $intSentSize += $_.TotalBytes
        }
    }
    
    Get-TransportService | Get-MessageTrackingLog -Recipients $Mailbox.PrimarySmtpAddress -ResultSize Unlimited -Start $From -End $To | ForEach {
        If ($_.EventId -eq "DELIVER") {
            $intRec ++
            $intRecSize += $_.TotalBytes
        }
    }
    }
    $intSentSize = $intSentSize/1MB
    $intSentSize = '{0:n4}' -f $intSentSize
    $intRecSize = $intRecSize/1MB
    $intRecSize = '{0:n4}' -f $intRecSize
    
    Write-Host "`nResult:`n--------------------`n"
    Write-Host "Total Sent:"$intSent, ", Total Sent Size(MB):"($intSentSize)
    Write-Host "Total Receive:"$intRec, ", Total Receive Size(MB):"($intRecSize)
    Write-Host "`n--------------------`n"

    Regards,

    Kyle Xu


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Friday, November 15, 2019 7:39 AM
    Moderator
  • Thanks for the script.  Looks like the script is targeted to each database.  I have about 70 database.  Is there a script which would generate a report for the whole Org?

    Thanks,

    Friday, November 15, 2019 5:19 PM
  • use in-place-hold instead of journaling. It's better.

    take a look auf Franky's Exchange Reporter. It's a very very good report. Work's fine. You can run the Script in english.

    https://www.frankysweb.de/exchange-reporter-2013/

    take a look of the reports :-)

    Sunday, November 17, 2019 6:26 PM
  • Thanks for the script.  Looks like the script is targeted to each database.  I have about 70 database.  Is there a script which would generate a report for the whole Org?

    Thanks,

    Remove “ -Database "YourDatabse"” from that script.

    Regards,

    Kyle Xu


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Monday, November 18, 2019 1:41 AM
    Moderator
  • Hi,

    I am writing here to confirm with you how thing going now?

    If the above suggestion helps, please be free to mark it as an answer for helping more people.

    Regards,

    Kyle Xu


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    • Marked as answer by ChrisD0919 Friday, November 22, 2019 3:06 AM
    Wednesday, November 20, 2019 11:35 AM
    Moderator
  • quick question.  Does the "Sent" include both internal and external?  The script uses "SMTP" to define 'Sent".  I'm not sure if it includes emails sent within the Org.

    Thanks,

    Saturday, November 23, 2019 2:34 AM