Exchange Powershell

How to Remove Soft Deleted Mailbox – Exchange PowerShell

After performing actions such as removing a mailbox or moving a mailbox from one database to another, a copy of this mailbox will remain for a period of time. This is called a soft deleted mailbox. In some instances you have performed one of these tasks to clear space in your Exchange database. To claim this space back your will need to remove the soft deleted mailbox.

First lets check to find out which mailboxes are soft deleted on a particular Database

Get-MailboxDatabase | Get-MailboxStatistics | Where { $_.DisconnectReason -ne $null } | fl DisplayName,MailboxGuid,Database,DisconnectReason

Output example

Now that you know which mailbox are soft deleted you can go ahead and remove this mailbox.

To so this use the command

Remove-StoreMailbox –Database Databasename –Identity “Username” –MailboxState SoftDeleted

Once you have removed this you can run the following command to see how much space the deletion has created.

get-mailboxdatabase -status | ft name,availablenewmailboxspace

Leave a Reply

Your email address will not be published. Required fields are marked *