issuewarningquota at two levels - not just one

by kwarden at 2013-02-13 20:50:38

We’ve just migrated to Exchange 2010 and management has finally agreed to impose "hard limits" on mailboxes.
We don’t want to prohibit receive, so the users still know when they have emails from clients, supervisors, etc.
My task is to provide 2 notices (issuewarningquota), plus the final notice of prohibitsend when a mailbox reaches the 1G limit.

Here’s what is needed, these are all company-wide:

Notice 1 at 800MB - to user only - issuewarningquota

Notice 2 at 900MB - to user and manager - issuewarningquota

Notice 3 at 1G - to user and manager - issuewarningquota and prohibit send

I don’t know how to:
1. Send a cc of the warning message to manager (the "manager" field in AD is already completed for all users)
2. Have essentially three different limits/sizes for issuewarningquota

I found this and thought I could make a ps1 and run it on a schedule every evening (somehow - jams, taskscheduler, etc, whatever):
$AllMailboxes = Get-Mailbox -resultsize unlimited | Get-MailboxStatistics |
foreach($Mailbox in $AllMailboxes){
$SizeMB = $Mailbox.TotalItemSize.Value.ToMB()
if(($SizeMB -gt 800)){Set-Mailbox $Mailbox.DisplayName -UseDatabaseQuotaDefaults $false -IssueWarningQuota 801MB -ProhibitSendQuota 1024MB -ProhibitSendReceiveQuota unlimited}
if(($SizeMB -gt 900)){Set-Mailbox $Mailbox.DisplayName -UseDatabaseQuotaDefaults $false -IssueWarningQuota 901MB -ProhibitSendQuota 1024MB -ProhibitSendReceiveQuota unlimited}
if(($SizeMB -gt 1000)){Set-Mailbox $Mailbox.DisplayName -UseDatabaseQuotaDefaults $false -IssueWarningQuota 1000MB -ProhibitSendQuota 1024MB -ProhibitSendReceiveQuota unlimited}

This taken from a different post sums up my situation:
I’m at a place where I can generally look at a script, figure out what it does and tweak it a bit for my purposes
[but I don’t know how to make my own from scratch or how to use all the variables].
I know it’s experience but there is still some magic in it for me. I’m learning what I can when I can so hopefully this gives me something to put in my toolbox for the future.
I can provide all the stuff I tried that DIDN’T work but there is a LOT of it - I’ve been trying for [four] days and haven’t had any luck.
I appreciate whatever guidance and help you might have for me.

Thank you all.
by DonJ at 2013-02-15 12:58:57
Why don’t we start with ONE thing that didn’t work, and go from there?

Also… if this is going to be a global change, why are you making a change to every mailbox instead of updating the database defaults? The whole point of the defaults is to make global changes like this.

The command you show sets a warning for mailboxes that are over-quota. Seems like it’d be easier just to set the quotas and warning policy centrally in the database… BEFORE the mailboxes go over. What you’re proposing - regularly running a script that sets quotas individually - is horribly inefficient. I mean… "if the mailbox is at 900, set the warning to 901" seems redundant. Just let it warn them at 900.

(And I’m not the Exchange expert, but I’m not sure it’s capable of issuing warnings to the user AND someone else - it only sends to the mailbox owner. Also, warnings are only sent if certain criteria is met - see … 98353.aspx. You can’t change this; it’s how Exchange works).