Microsoft Exchange Administration Tips

Ever found yourself in a situation where all your staff have an unlimited quota for their Exchange mailboxes? Or you wanted to find out who your biggest culprits for large mailboxes were?

I ran into a situation yesterday where a manager requested that a quota be applied to all mailboxes but providing exclusions to the higher ups ūüôā now when you’re talking about a small site with 10 users it doesn’t sound too bad but as soon as your mailbox database starts dealing with hundreds or thousands of users, things don’t seem quite as easy. Fear not! Powershell is here to save us all!

Here are a few simple commands that may help you:

View all mailbox quotas
get-mailbox -filter { usedatabasequotadefaults -eq $false -AND recipientTypeDetails -eq ‘usermailbox’ ¬†}

Retrieve mailbox sizes
Get-MailboxStatistics -Database “Mailbox Database Name” | Select DisplayName, ItemCount, TotalItemSize | Sort-Object TotalItemSize -Descending | Export-CSV C:\MailboxSizes.csv

Set all mailboxes to use database defaults
get-mailbox -filter { usedatabasequotadefaults -eq $false -AND recipientTypeDetails -eq ‘usermailbox’ ¬†} | set-mailbox -UseDatabaseQuotaDefaults $true

Excluding special users

  1. Open Exchange Management Console
  2. Go to Microsoft Exchange On-Premises > Recipient Configuration > Mailbox.
  3. Locate the mailbox you want to provide an exception for. Right click and select properties.
  4. Click on Mailbox Settings > Storage Quota > Properties
  5. Untick “Use mailbox database defaults”
  6. Tick the options required and set the values for warning, prohibit send etc.

Now that you’ve set an awesome default mailbox size limit, want some customised warning messages? You know it!

Customize Quota Messages

Warning 
New-SystemMessage -QuotaMessageType WarningMailbox -Language EN -Text “Your mailbox is now within xMB of the allowable size limit. Please clean out emails to reduce your mailbox size. Move items to public folders or delete any items you don’t need from your mailbox and empty your Deleted Items folder.”

Prohibit Send
New-SystemMessage -QuotaMessageType¬†ProhibitSendMailbox¬†-Language EN -Text “Your mailbox can no longer send messages as the size limit has been reached. Please reduce your mailbox size. Move items to public folders or delete any items you don’t need from your mailbox and empty your Deleted Items folder.”

Prohibit Send and Receive (Ouch!)
New-SystemMessage -QuotaMessageType ProhibitSendReceiveMailbox -Language EN -Text “Your mailbox can no longer send or receive messages as the size limit has been reached. Please reduce your mailbox size. Move items to public folders or delete any items you don’t need from your mailbox and empty your Deleted Items folder.”