locked
find mailboxes nearing quota RRS feed

  • Question

  • does anyone know of a good way to find all mailboxes nearing:

    ProhibitSendQuota or IssueWarningQuota

    i would like to run a script that will:

    get-mailbox -ResultSize Unlimited | get-mailboxstatistics

    then find all mailboxes that are about 10%\20%  away from hitting ProhibitSendQuota or IssueWarningQuota

    This is to be PROACTIVE as opposed to waiting until the mailboxes hit the quotas and start firing warning or disable.

    NOTE: if we can filter it to include ONLY Lithold users that would be best.

    Friday, January 9, 2015 7:50 PM

Answers

  • Well, probably better to get the "digit only" value anyway:

    $mailboxes | select Name,Alias,Prohib*, @{n="IssueWarningQuota";e={($_.IssueWarningQuota).ToString().Split("(")[1].Split(" ")[0]}}, @{n="Usage";e={(Get-MailboxStatistics $_.Identity).TotalItemSize.ToString().Split("(")[1].Split(" ")[0]}}
    

    Replace for the two other quotas if needed.

    • Proposed as answer by Amit Tank Friday, January 9, 2015 11:05 PM
    • Marked as answer by Amy.Wang Monday, January 19, 2015 7:24 AM
    Friday, January 9, 2015 8:58 PM
  • Just extending the Powershell on what Vasil explained, last one will give you IssueWarning%, if it shows 80 or 90 then that's the mailbox that you are looking for...

    $mailboxes = Get-Mailbox -ResultSize Unlimited
    
    $mailboxes | ft Name,Alias, @{n="IssueWarningQuota";e={($_.IssueWarningQuota).value.toMB()}}, @{n="Usage";e={(Get-MailboxStatistics $_.Identity).TotalItemSize.value.toMB()}}, @{n="IssueWarning%";e={[math]::truncate((100-((Get-MailboxStatistics $_.Identity).TotalItemSize.value.tokb())/(($_.IssueWarningQuota).value.tokb()/100)))}}


    Amit Tank | Exchange - MVP | Blog: exchangeshare.wordpress.com 

    • Proposed as answer by Amit Tank Friday, January 9, 2015 11:05 PM
    • Marked as answer by Amy.Wang Monday, January 19, 2015 7:24 AM
    Friday, January 9, 2015 11:05 PM
  • Hi,

    I have a test in my environment using Exchange 2013, the cmdlet Amit provided will list all the mailboxes' IssueWarningQuota, Usage and then calculate the "IssueWarning%". Note that if the IssueWarningQuota is set to unlimited, the value of "IssueWarning%" is empty.

    Hope this can be helpful to you.

    Best regards,


    Amy Wang
    TechNet Community Support

    • Proposed as answer by Amy.Wang Monday, January 19, 2015 2:54 AM
    • Marked as answer by Amy.Wang Monday, January 19, 2015 7:24 AM
    Tuesday, January 13, 2015 8:29 AM

All replies

  • You can easily filter out only the mailboxes on litigation hold:

    $mailboxes = Get-Mailbox -Filter {LitigationHoldEnabled -eq "True"} -RecipientTypeDetails UserMailbox -ResultSize Unlimited

    And the cycle over each of them and get the statistics:

    $mailboxes | select Name,Alias,Prohib*,Issue*,@{n="Usage";e={(Get-MailboxStatistics $_.Identity).TotalItemSize}}

    At this point I would stop and export the results to CSV so that I can easily go over them using Excel, but if you prefer you can of course script the size comparison with PowerShell.

    Friday, January 9, 2015 8:53 PM
  • Well, probably better to get the "digit only" value anyway:

    $mailboxes | select Name,Alias,Prohib*, @{n="IssueWarningQuota";e={($_.IssueWarningQuota).ToString().Split("(")[1].Split(" ")[0]}}, @{n="Usage";e={(Get-MailboxStatistics $_.Identity).TotalItemSize.ToString().Split("(")[1].Split(" ")[0]}}
    

    Replace for the two other quotas if needed.

    • Proposed as answer by Amit Tank Friday, January 9, 2015 11:05 PM
    • Marked as answer by Amy.Wang Monday, January 19, 2015 7:24 AM
    Friday, January 9, 2015 8:58 PM
  • Just extending the Powershell on what Vasil explained, last one will give you IssueWarning%, if it shows 80 or 90 then that's the mailbox that you are looking for...

    $mailboxes = Get-Mailbox -ResultSize Unlimited
    
    $mailboxes | ft Name,Alias, @{n="IssueWarningQuota";e={($_.IssueWarningQuota).value.toMB()}}, @{n="Usage";e={(Get-MailboxStatistics $_.Identity).TotalItemSize.value.toMB()}}, @{n="IssueWarning%";e={[math]::truncate((100-((Get-MailboxStatistics $_.Identity).TotalItemSize.value.tokb())/(($_.IssueWarningQuota).value.tokb()/100)))}}


    Amit Tank | Exchange - MVP | Blog: exchangeshare.wordpress.com 

    • Proposed as answer by Amit Tank Friday, January 9, 2015 11:05 PM
    • Marked as answer by Amy.Wang Monday, January 19, 2015 7:24 AM
    Friday, January 9, 2015 11:05 PM
  • thank you for the replies.

    i will check these out when i get back on Monday.

    Friday, January 9, 2015 11:15 PM
  • Hi,

    I have a test in my environment using Exchange 2013, the cmdlet Amit provided will list all the mailboxes' IssueWarningQuota, Usage and then calculate the "IssueWarning%". Note that if the IssueWarningQuota is set to unlimited, the value of "IssueWarning%" is empty.

    Hope this can be helpful to you.

    Best regards,


    Amy Wang
    TechNet Community Support

    • Proposed as answer by Amy.Wang Monday, January 19, 2015 2:54 AM
    • Marked as answer by Amy.Wang Monday, January 19, 2015 7:24 AM
    Tuesday, January 13, 2015 8:29 AM
  • testing it all now.

    looks promising :)

    will update shortly

    Wednesday, January 14, 2015 8:48 PM
  • Hi,

    how to sort your command with IssueWarning%?

    Thanks

    Wednesday, January 8, 2020 7:13 AM
  • Anybody?
    Thursday, February 20, 2020 8:18 AM