Email This List Email This List Print This List Print This List

Exchange 2010 data­base cre­ate free space (white space)

Every mail­box data­base in Exchange 2010 has white space. It’s free space which can be used before .edb file will grow.

Some­times we need to cre­ate free space in data­base right now if we want to avoid of grow­ing of .edb file.

To get free space in mail­box data­base we can do the fol­low­ing:

  • move few mail­boxes from mail­box data­base to oth­er mail­box data­base
  • purge dis­abled mail­boxes
  • purge soft-deleted mail­boxes

 

Exchange 2010 check Avail­able­New­Mail­box­Space (white space) in data­base:

We can check avail­able white space for new mail­boxes in mail­box data­bases using power­shell like below:

Get-MailboxDatabase -server MBX1 | select Name, DatabaseSize, AvailableNewMailboxSpace

or if we want to check only one mail­box data­base:

Get-MailboxDatabase DB01 | select Name, DatabaseSize, AvailableNewMailboxSpace

 

If we want to see all dis­abled mail­boxes (dis­abled today) in data­base we have to wait for sched­uled Cleanup Agent or we can run it from power­shell:

Get-MailboxDatabase -server MBX1 | Clean-MailboxDatabase

When we run above com­mand, all mail­boxes dis­abled today, will be marked as dis­abled and we can find them in Dis­con­nec­ted Mail­boxes.

 

Exchange 2010 list dis­abled mail­boxes:

We can get inform­a­tions about dis­abled mail­boxes to know how much space we will get when we purge dis­abled or soft-deleted mail­boxes.

To list all dis­abled mail­boxes in all mail­box data­bases in serv­er MBX1 run:

Get-MailboxStatistics -server MBX1 | where {$_.DisconnectReason -eq "Disabled"} | select DisplayName, @{label="Mailbox Size (MB)";expression={$_.TotalItemSize.Value.ToMB()}}, DisconnectDate, DatabaseName

or if we want to check only one mail­box data­base:

Get-MailboxStatistics -Database DB01 | where {$_.DisconnectReason -eq "Disabled"} | select DisplayName, @{label="Mailbox Size (MB)";expression={$_.TotalItemSize.Value.ToMB()}}, DisconnectDate

If we want to know only how much space in MB deal all dis­abled mail­boxes in data­base we can use belowed com­mand:

Get-MailboxStatistics -Database DB01 | where{$_.DisconnectReason -eq "Disabled"} | %{$_.TotalItemSize.Value.ToMB()} | Measure-Object -sum

or

$(Get-MailboxStatistics -Database DB01 | where{$_.DisconnectReason -eq "Disabled"} | %{$_.TotalItemSize.Value.ToMB()} | Measure-Object -sum).sum

Exchange 2010 Soft-Deleted mail­boxes:

Now we know how to get list and size of all dis­abled mail­boxes.

Also if we move mail­box from one mail­box data­base to oth­er in source mail­box data­base we can find hid­den mail­boxes with Dis­con­nectReas­on status Soft­De­leted.

We can get list and size of Soft­De­leted mail­boxes like above but we have to use:

$_.DisconnectReason -eq "SoftDeleted"

instead of Dis­abled.

 

Exchange 2010 remov­ing dis­abled and soft-deleted mail­boxes:

We know how to check data­base Avail­able­New­Mail­box­Space, list dis­abled and soft deleted mail­boxes and size, now to increase white space in mail­box data­base we need to remove dis­abled and soft deleted mail­boxes from mail­box data­base.

To remove all dis­abled mail­boxes from mail­box data­base DB01 we have to first get list of those mail­boxes and then remove them:

$MBXs = Get-MailboxStatistics -Database DB01 | where {$_.DisconnectReason -eq “Disabled”}

we have list of all dis­abled mail­boxes in data­base DB01 in vari­able $MBXs, and now we will remove all dis­abled mail­boxes:

$MBXs | foreach {Remove-StoreMailbox -Database $_.database -Identity $_.mailboxguid -MailboxState Disabled -Confirm:$false}

The same oper­a­tion we can take with soft deleted mail­boxes but we need to use Soft­De­leted instead of Dis­abled.

 

Now we can again check mail­box data­base white space:

Get-MailboxDatabase DB01 | select Name, DatabaseSize, AvailableNewMailboxSpace

 

Some­times if in mail­box data­base prop­er­ties we checked option:

Don’t per­man­ently delete items until the data­base has been backed up

dis­abled mail­boxes will be purged after we make backup of mail­box data­base.
But all mail­boxes dis­abled or moved before we make backup and if we purge those mail­boxes after backup, we will get white space imme­di­ately in mail­box data­base.

Related Post

admin has written 133 articles