I am Dale Hayter, a Microsoft and VMware certified Technical Consultant.

My blog has been built up over the years from my experience of working on an IT helpdesk and also from being out on-site.

Purge Soft Deleted Mailboxes, create white space.

If you move a mailbox to a new database or delete a user the original mailbox is put into a soft deleted state. It will remain in the original database until the next maintanence schedule.

If you want to purge them straight away to free up some space in your database then run the following.

The first powershell command enumerates all the mailboxes in your organisation in this state.

$Mailboxes = Get-MailboxDatabase | Get-MailboxStatistics | where {$_.DisconnectReason -eq “SoftDeleted”}

The next command purges them

$Mailboxes | foreach {Remove-StoreMailbox -Database $_.database -Identity $_.mailboxguid -MailboxState SoftDeleted}

If you are carrying this out on LOTS of mailboxes, to confirm yes for each

$Mailboxes | foreach {Remove-StoreMailbox -Database $_.database -Identity $_.mailboxguid -MailboxState SoftDeleted -confirm:$false}

If you want to confirm the white space you have after then the command below will list the space in each database available.

Get-MailboxDatabase -Status | ft name,databasesize,availablenewmailboxspace -auto