Recently I had a situation to delete all the mail boxes from some of the exchange databases due to the non-reparable corruption on the exchange edb file. It was unable to repair edb database using the eseutil utility or any other way. I don’t have a valid backup to recover the database. So, I have adopted the below method to restore the mailboxes.

1. Exported all mail box users list in CSV format using the exchange ECP. I have selected all the columns during the export.

2. Disabled all the mail boxes in the corrupted database using the below Power shell code. (Disable won’t delete any users from active directory). Ignore all warnings.

Get-Mailbox -Database Large | Disable-Mailbox

3. Created a new mailbox

4. Deleted all another database users from the exported list. I have used free CSV editor tool CSVpad to do this.

Also on the database column of CSV, I have changed the database name as new database. Made some changes on the column names (manually on CSV file) to map it properly on below script to make database of existing active directory users from CSV

import-csv "C:\Temp\Export3.csv" | foreach {enable-MailBox -identity $_.ALIAS -PrimarySmtpAddress $_.PrimarySmtpAddress -Alias $_.ALIAS -Database $_.DATABASE}

5. Copied the file to the “C:\Temp\” folder and executed the above script. New empty mailboxes created for all users.

6. Using an application (Its a paid version):- edb to exchange migration toolkit from, I have restored all emails, contacts etc of all users from the corrupted edb file to each users mail boxes. (Its taken a long time depends on mailbox contents)

7. Restored the disconnected In-Place archive,See the post: for more details