When users are deleted from the Active Directory, the Exchange mailboxes are not automatically deleted but disconnected. This means that the mailbox still exists in the database, but is no longer assigned to a user.
If the user associated with a mailbox has only recently been deleted, the disconnected mailbox will not be displayed directly in the list of disconnected mailboxes in the Exchange administration console. If you do not want to wait until Exchange automatically searches for disconnected mailboxes, you can initiate this yourself using the following command:
Get-MailboxDatabase | Clean-MailboxDatabase
The disconnected mailboxes are then displayed in the Exchange administration console, where they can be reconnected but not deleted. The mailbox can only be deleted via the GUID of the mailbox. This can be displayed as follows:
get-mailboxdatabase | get-mailboxstatistics | Where{ $_.DisconnectDate -ne $null } |fl displayName,Identity,disconnectdate
Möchte man nun das Postfach löschen, kopiert man sich den Wert der bei „Identity“ steht und hängt ihn an den Remove-MailboxDatabase Befehl an:
Remove-mailbox -database „Name der Mailbox Datenbank“ -storemailboxidentity „Wert der bei Identity steht“
Example:
Remove-mailbox -database „MailBoxDatabase01“ -storemailboxidentity 853ad730-7111-4569-ad54-ef002046e97f
Note:
There was a change here with Service Pack 1, more details can be found here: https://www.frankysweb.de/?p=209