Refresh Disconnected Mailboxes

If you ever need to force a refresh of the disconnected mailboxes on Exchange, the following command will do this for all mailbox databases.

Get-Mailboxdatabase | Clean-MailboxDatabase

I recently had to do this because one of my clients recently created a mailbox for a new employee, but didn’t realize until a few days later they had misspelled the employee’s last name, but not before they had generated a bit of internal email for the new hire.   Since so many things like logon scripts and folder redirections rely on the username, I could have fixed the display name, but would have had to leave the username unchanged and mis-spelled or risk breaking other things that I just didn’t want to deal with.  I directed the client to delete the old account and create a new one, but not create a mailbox this time.  After forcing the refresh I was able to easily reconnect the mailbox to the new correctly spelled user account, without the user loosing any data from their mailbox, or the need to export it to a PST and re-import it.