I love exchange and have used it for several years each version adds functionality but sometimes they make things harder than they need to be.
You’ll have to use the Exchange Management Shell to accomplish these tasks.
This command will remove the mailbox and leave the user (disconnects it then you can get rid of the disconnected mailbox):
Disable-Mailbox -Identity domain\user
You’ll need to run the Clean-MailboxDatabase command to get Exchange to disconnect the mailbox so you can get rid of it.
Clean-MailboxDatabase
The Clean-MailboxDatabase prompts for Identity, this is the name of your mailbox database. In my case, and I think the default, it’s Mailbox Database.
At this point you can go to the disconnected mailbox area of the Exchange console, hit refresh and you can see the disconnected mailbox.
Now, to get rid of disconnected mailboxes.
Show all disconnected mailboxes:
Get-MailboxStatistics | where-object { $_.DisconnectDate -ne $null } | Select DisplayName,MailboxGuid
Remove a single box:
Remove-Mailbox -Database <Database-Name> -StoreMailboxIdentity <MailboxGuid> -confirm:$false
Group them together and remove all:
$users = Get-MailboxStatistics | where-object { $_.DisconnectDate -ne $null } | Select DisplayName,MailboxGuid
$users | ForEach { Remove-Mailbox -Database “Mailbox Database” -StoreMailboxIdentity $_.MailboxGuid -confirm:$false }
See the size of mailboxes sorted by size:
Get-MailboxStatistics | Sort-Object TotalItemSize –Descending | ft DisplayName,@{ expression={$_.TotalItemSize.Value.ToKB()}},ItemCount