The most important codes used for Microsoft Exchange Importing

Hi guys, Last week I had a problem with Microsoft Exchange databases and one of my databases are corrupted. There had 60 users in the corrupted database and again there were 74 non-working users anymore in the same database. Even I’m not mentioned in the other databases users.

Thank god I had backup file because I was taking every night full backup. I hadn’t seen this problem before it. I could have recovered my database but I couldn’t be sure and I choose the hard way for this job. This progress continued for a week but I’m also done. Finally, I have overcome this problem successfully. I want to give thanks to Hakan Uzuner and Efe Sülükçü for helping me in this case.

I used codes at the below and started tracking the progress for hours.

The most important codes used for Microsoft Exchange Importing at the below.

Importing a user’s pst file

New-MailboxImportRequest -Mailbox Alias.Name -FilePath \\servername\PSTExport\PstName.pst

If there are bad items in the database while importing request, you can add this code at the end of the importing request code. It will ignore until 100 bad items.

New-MailboxImportRequest -Mailbox Alias.Name -FilePath \\servername\PSTExport\PstName.pst -BadItemLimit 100 -AcceptLargeDataLoss

If you want to see importing requests as percentage;

Get-MailboxImportRequest | Get-MailboxImportRequestStatistics -IncludeReport

If you want to delete importing request situations completed or failed;

Get-MailboxImportRequest -Status Completed | Remove-MailboxImportRequest

Get-MailboxImportRequest -Status Failed | Remove-MailboxImportRequest

You can resume the progress which importing request is failed.

Get-MailboxImportRequest -Status Failed | Resume-MailboxImportRequest

If you want to export the situation of the failed request to a .txt file.

Get-MailboxImportRequest -Status Failed | Get-MailboxImportRequestStatistics -IncludeReport | fl > C:\Importsallfailedreport.txt

If you want to export the bad items to a .txt file.

Get-MailboxImportRequest -Status Failed | Get-MailboxImportRequestStatistics -IncludeReport | Format-List | out-file baditems.txt

If you want to see which databases belong to which users.

Get-Mailbox | Sort database, name | Format-Table name, database

Thanks for reading.

See you later in another article.

tr_TRTR