Duplicates are being imported

LeighHarding 1 Reputation point
2021-06-22T01:42:59.563+00:00

Hello, I am using the New-MailboxImportRequest to import .PST files into existing mailboxes. These mailboxes have emails in them that are also included in the .PST file being imported. The import request completes successfully, some needing the BadItemLimit to be set. After importing the .PST file, I am noticing that duplicates have been created for emails and contacts. From this site, https://learn.microsoft.com/en-us/powershell/module/exchange/new-mailboximportrequest?view=exchange-ps I understand that duplicates are not imported. This is an example of the PowerShell command used: New-MailboxImportRequest -FilePath "\ServerName\FolderLocation\UserName.pst" -BadItemLimit 10 -Mailbox "UserName"
This is an on premiss Exchange 2016 server.
So, to my questions, How do I stop the duplicates from being imported? And How do I remove the duplicates for those already imported?

Exchange Online
Exchange Online

A cloud-based service included in Microsoft 365, delivering scalable messaging and collaboration features with simplified management and automatic updates.

Exchange | Exchange Server | Management
Exchange | Exchange Server | Management

The administration and maintenance of Microsoft Exchange Server to ensure secure, reliable, and efficient email and collaboration services across an organization.

Exchange | Hybrid management
Exchange | Hybrid management

The administration of a hybrid deployment that connects on-premises Exchange Server with Exchange Online, enabling seamless integration and centralized control.

0 comments No comments

3 answers

Sort by: Most helpful
  1. KyleXu-MSFT 26,406 Reputation points
    2021-06-23T04:21:12.283+00:00

    @LeighHarding

    I think there exist copy in the PST file that you used to import. I would suggest you have a check about it before importing.

    By default, the import will could merger PST file with target mailbox.
    108434-qa-kyle-12-13-00.png
    Based on my testing, if there exist duplicate in the PST file, the import operation will not delete the duplicate from target mailbox.

    Such as:

    1. If there exist email "Tes54321" and a copy "Test54321" in a mailbox. If I export data and import data to this mailbox, there will exist 4 emails which called "Test54321".
    2. If there only exist an email "Test54321" and doesn't exist copy. If I export data and import data to this mailbox, there will only exist 1 email which called "Test54321"

    As a solution, you can use the Outlook "Clean Up“ function to delete all duplicates from this mailbox directly:
    108435-1234.gif


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

  2. Ted Mittelstaedt 61 Reputation points
    2026-07-31T14:31:46.2666667+00:00

    This is normal behavior from your description. The old database had 1 name the new database had another. The database name is part of the metadata for the message. So you created an empty mailbox, restored from backup, which put 1 copy of a message into the new database and restored from pst which put another copy in. So either 1 of 2 things happened. First veem backup/restore was being helpful by changing the name of the metadata to the new name during it's import and the import from pst via powershell was not, so the server saw these as not duplicates. Second, veem restore didn't change the metadata of the database name, but the outlook pst file didn't have the database name in it's metadata and so the powershell import added the new database name as part of the metadata.

    The basic takeaway here is you cannot trust imports/exports from psts from either different sources or using different tools to not gracefully handle conflicts. The most common example often cited is importing a pst file created by powershell export on an old mailserver to a new mailserver, then importing a pst created by export from an .ost file into a .pst file that covers the same date range. Remember that the .pst file format has never been "officially" documented by Microsoft, and the only 2 known tools out there that create .pst files are Outlook, and the API's within exchange that are used by some backup/restore tools that have the capability of restoring from backup into a pst, and by the powershell import/export commands. All the backup/restore tools I have ever seen that can "create" pst's depend on hacks like loading outlook on the machine you are running the backup restore tool from or having an exchange server somewhere (such as the target) so they clearly are using APIs inside of Outlook or in Exchange to create the PST

    Was this answer helpful?

    0 comments No comments

  3. LeighHarding 1 Reputation point
    2021-06-24T03:05:39.62+00:00

    @KyleXu-MSFT
    Thanks for your suggestions.
    I can confirm there is only 1 email in the .pst file used during the import process. After the import, there are 2 showing in the mailbox.
    The Outlook Clean Up function is not removing the duplicated emails, both are still present.
    I have checked this with multiple PST files and mailboxes.
    The 2 emails in the mailbox show the same time and date, they both have the same content.
    Checking the Internet Headers for the duplicated emails shows both are the same.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.