Exchange 2007: Purge mailboxes
With 2003 Exchange purging users was super simple through the GUI, you simply ran your clean up agent after deleting the mailbox and then you saw the disconnected mailbox then right click and purge, it was effortless. 2007 is certainly not effortless but its not all that hard either, you just have to start using more PowerShell, which is not such a bad thing, so here is how:
Step 1
First thing is first, Find the mailbox you wish to delete within the console, once you have located the account right click and choose remove, be warned this will also remove the AD account associated with the mailbox if you only want to remove the mailbox then choose disable.
Ok so you have now disconnected the mailbox you can no longer see this in the mailbox list, and there is a good chance you cant see it in the disconnected Mailbox just yet either.
Step 2
Open PowerShell and run this
get-mailboxdatabase
This command will show you your database name, copy the database name and then issue the below command, replacing the MailboxDatabaseHere with your database name
Step 3
Clean-Mailboxdatabase "MailboxDatabaseHere"
This clean-Mailbox database is the same as the clean up agent that was found in 2003’s GUI, once you have successfully ran this command go back to the GUI and see if you can see the mailbox you removed in the ‘Disconnected Mailbox’, once you can see it you will be able to delete the mailbox if not see step 5.
Step 4
If you are unlucky and you cant yet see it then hit refresh in the right pane…. Still cant see it ok, open PowerShell once again and run the below command:
Get-MailboxStatistics | Sort-Object DisplayName -Descending | ft DisplayName,@{label="TotalItemSize(KB)";expression={$_.TotalItemSize.V alue.ToKB()}},ItemCount
This will return a list of all mailboxes in alphabetic order
With this list locate the mailbox you have just removed, and take note of the ‘DisplayName’
Step 5
Now that we can see the mailbox here we need can then purge the mailbox do this by running the below command be sure to change ‘MailboxDatabaseHere’ to your Exchange database and also change the ‘DisplayName’ to your account name, found using the above script.
Remove-Mailbox -Database "MailboxDatabaseHere" –StoreMailboxIdentity DisplayName -confirm:$true
That’s it your mailbox is no longer you have successfully purged it, not so hard after all.