Powered by Ed Buford and Coffee

Category: MailboxDatabase

Clean that Database!

Clean Database command missing in Exchange 2013

Sometimes you need to disable a mailbox you need to be able to see it as a disconnected mailbox right away. In the Past you’ve been able to use the Clean-Mailboxdatabase command.  I would normally tend to run the clean command against all databases since the command doesn’t draw much in the way of resources. So for me the command would look like this:    Get-Mailboxdatabase | Clean-Mailboxdatabase

But as with everything the times are constantly changing and so are the commandlets that go with them. Which brings me to Exchange 2013 where the Clean-Mailboxdatabase command no longer works. Now the command is Update-StoreMailboxState and sadly it’s not a simple command to clean all the databases – in fact to run the command you need to know the database and mailbox GUID. Now this is going far… but I digress…

Anyway if you know the database you can attack it like this:

Get-MailboxStatistics –Database DB01 | ForEach { Update-StoreMailboxState -Database $_.Database -Identity $_.MailboxGuid -Confirm:$false }


GetMailboxStatistics Database MDB02 |ForEach { UpdateStoreMailboxState Database $_.Database Identity $_.MailboxGuid Confirm:$false }

Setting Mailbox Database Limits with PowerShell

While doing an install or migration of Exchange to a new server one of the things I often need to do is configure all the mailbox databases at once to unlimited.
Now this is something you can certainly in the GUI but if you have more than 1 database to change then the GUI gets old fast.
You can do this easily in the Exchange Management Shell.

First you might want to record the current settings. I would run this Command to view the current settings:
*in each of these examples change SERVERNAME to the name of your server.

Get-MailboxDatabase -Server SERVERNAME | FL name,issuewarningquota,prohibitsendquota,prohibitsendrecievequota

To set the Issue Warning Quota:

Get-MailboxDatabase -Server SERVERNAME | Set-MailboxDatabase -IssueWarningQuota unlimited


To Set the Prohibit Send Quota:

Get-MailboxDatabase -Server SERVERNAME | Set-MailboxDatabase -ProhibitSendQuota unlimited


To Set the Prohibit Send / Receive Quota:

Get-MailboxDatabase -Server SERVERNAME | Set-MailboxDatabase -ProhibitSendReceiveQuota unlimited


IF you want to set all at the same time:

Get-MailboxDatabase -Server SERVERNAME | Set-MailboxDatabase -IssueWarningQuota unlimited  -ProhibitSendReceiveQuota unlimited -ProhibitSendQuota unlimited