Connecting the Disconnected in Exchange 2010

My article for Simple-Talk on mailbox and personal archive deletion, recovery and purging in Exchange 2010 has been published on Simple Talk.

The article is about:

  • The relationships between Active Directory and Mailboxes and Archives in the store;
  • Mailbox Retention;
  • Deleting and Recovering a Mailbox
  • Deleting and Recovering a Personal Archive
  • Linked Mailboxes
  • Cleanup

You can check out the article, titled Connecting the Disconnected in Exchange 2010, at:
http://www.simple-talk.com/sysadmin/exchange/connecting-the-disconnected-in-exchange-2010/

Note: I submitted the following additional SP1 info to the publisher so this information might be included in the article at some point.

Since writing the article SP1 was released which contains a new cmdlet to purge mailboxes, Remove-StoreMailbox. This is also great for situations when you’ve moved a lot of mailboxes and you need to make that space available in the source database (when moved, mailboxes are soft-deleted). Usage is as follows:

Remove-StoreMailbox -Database <DatabaseID> -Identity <MailboxID> -MailboxState [Disabled|SoftDeleted]

For example, to remove pmortimer’s mailbox from database DB1 after moving it elsewhere, use:

Remove-StoreMailbox –database DB1 –identity pmortimer –MailboxState SoftDeleted

The command to remove all SoftDeleted mailboxes from database DB1 would be:

Get-MailboxStatistics -Database DB1 | where {$_.DisconnectReason -eq “SoftDeleted”} | foreach {Remove-StoreMailbox -Database $_.database -Identity $_.mailboxguid -MailboxState SoftDeleted}

The new Remove-StoreMailbox cmdlet also enables us to use single command for removing all disconnected mailboxes:

Get-MailboxStatistics –Database DB1 | Where-Object {$_.DisconnectReason –eq “Disabled”} | ForEach {Remove-StoreMailbox –Database $_.database –identity $_.mailboxguid –MailboxState Disabled

This entry was posted in Exchange Server and tagged , by Michel de Rooij. Bookmark the permalink.
Unknown's avatar

About Michel de Rooij

Michel de Rooij, with over 25 years of mixed consulting and automation experience with Exchange and related technologies, is a consultant for Rapid Circle. He assists organizations in their journey to and using Microsoft 365, primarily focusing on Exchange and associated technologies and automating processes using PowerShell or Graph. Michel's authorship of several Exchange books and role in the Office 365 for IT Pros author team are a testament to his knowledge. Besides writing for Practical365.com, he maintains a blog on eightwone.com with supporting scripts on GitHub. Michel has been a Microsoft MVP since 2013.

Leave a comment