none
Help ignoring duplicate external email addresses while importing CSV RRS feed

  • Question

  • I'm trying to import a CSV file through power shell.  When the script gets to a duplicate email address, it does not import the contact.  I need to learn how to get my script to ignore duplicate email addresses:

    Bob Smith Info@Contoso.com

    Fred Jones Info@Contos.com

    I need the script to add both of these, however it won't add the second when it sees the email address already exists.  I've searched for what to add to force this but no luck.

    Import-Csv .\ContososContacts.csv|%{New-MailContact -Name $_.Name -DisplayName $_.Name -ExternalEmailAddress $_.ExternalEmailAddress -FirstName $_.FirstName -LastName $_.LastName}

    Monday, May 6, 2019 9:13 PM

Answers

  • If I'm not wrong ExternalEmailAddresses have to be unique. You cannot have two contacts with the same external email address.

    Live long and prosper!

    (79,108,97,102|%{[char]$_})-join''


    • Edited by BOfH-666 Monday, May 6, 2019 10:16 PM
    • Marked as answer by turtle266 Tuesday, May 7, 2019 3:16 PM
    Monday, May 6, 2019 10:16 PM

All replies

  • If I'm not wrong ExternalEmailAddresses have to be unique. You cannot have two contacts with the same external email address.

    Live long and prosper!

    (79,108,97,102|%{[char]$_})-join''


    • Edited by BOfH-666 Monday, May 6, 2019 10:16 PM
    • Marked as answer by turtle266 Tuesday, May 7, 2019 3:16 PM
    Monday, May 6, 2019 10:16 PM
  • Well that's a bummer!
    Tuesday, May 7, 2019 3:17 PM