purge the disconnected mailbox immediately as you like

07 Apr

if want to remove a mailbox,  you have to run remove-mailbox in exchange 2007, right? but as the system design, you can not remove the mailbox immediately.

after you run

Remove-Mailbox -Identity <MailboxIdParameter> 

the mailbox will appared in disconnected mailbox. if not you should run

clean-MailboxDatabase -Identity <DatabaseIdParameter> 

But what you want is “purge the mailbox from the database totally”. You should use another function of remove-mailbox.

Get-MailboxStatistics | where-object { $_.DisconnectDate -ne $null } | Select DisplayName,MailboxGuid 
Remove-Mailbox -Database <Database-Name> -StoreMailboxIdentity <MailboxGuid>

bulk opterate:

Get-MailboxStatistics |? { $_.DisconnectDate -ne $null } | Select MailboxGuid | ForEach `

{ Remove-Mailbox -Database "Your Mailbox Database" -StoreMailboxIdentity $_.MailboxGuid -confirm:$false }


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: