Mit dem Service Pack 1 für Exchange Server 2010 hat sich hinsichtlich getrennter Postfächer etwas geändert. Es gibt ein neues CMDlet mit dem getrennte Postfächer gelöscht werden können. Mit Exchange 2010 ohne Service Pack 1 funktionierte das wie here beschrieben über „Remove-Mailbox“
Seit Service Pack 1 für Exchange 2010 ist nun das CMDlet „Remove-StoreMailbox“ hinzugekommen. Das neue CMDlet ist nur für getrennte Postfächer zuständig. Aktive (Online) Postfächer können damit nicht gelöscht werden.
Die Vorgehensweise bleibt wie bei „Remove-Mailbox“ zunächst gleich:
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,database
Ab hier geht es nun mit dem neuem CMDlet weiter:
Remove-StoreMailbox -database „Name der Datenbank“ -Identity „Wert der bei Identity steht“ -MailboxState SoftDeleted
Example:
Remove-StoreMailbox -database „MBDB01“ -Identity „bcfd82dc-0b14-4ee3-aceb-f369159ddbc1“ -MailboxState SoftDeleted
Das Beispiel löscht ein Postfach welches den Status „SoftDeleted“ hat. Ein deaktiviertes Postfach löscht man indem man den Parameter „-MailBoxState“ auf „Disabled“ setzt.
Example:
Remove-StoreMailbox -database „MBDB01“ -Identity „bcfd82dc-0b14-4ee3-aceb-f369159ddbc1“ -MailboxState Disabled
Die Unterschiede zwischen den SoftDeleted und Disabled werde ich im nächsten Beitrag beschreiben.
Hallo Frank,
sehr schöne zusammenhängende Infos, genau das was ich brauche.
Leider gibt es den Clean-MailboxDatabase auf Exchange 2016 nicht.
Eine Vorgehensweise hierzu habe ich nicht gefunden.
Mein Ziel ist es den gesamten Inhalt der User Mailbox zu leeren um einen fehlgeschlagenen PST Import erneut zu starten.
Sehr guter Artikel! Danke dafür. Habe die Befehle schon oft benutzen müssen.
Gruß
Lennart