Import Contact in Exchange with CSV RRS feed

  • Question

  • Hello everyone,

    I try to import the contacts that I have received and import them into our Exchange.
    So I made a script as follows:

     $Contacts = "C:\userslist.csv"
    Import-Csv $Contacts | ForEach-Object { New-MailContact -Name $_."Name" -ExternalEmailAddress $_."Email-Address" -FirstName $_."firstname" -LastName $_."lastname" -OrganizationalUnit "OU=TestGPO,DC=Domain,DC=be" | Set-Contact -MobilePhone $_."mobile" -Department $_."Department" -Phone $_."phone" -Company $_."company"}

    Here is the CSV file that I use for my test ...

    Name Email-Address firstname lastname  mobile  Department  phone company
    Test Contact12345 Testcontact12345@test.com Test Contact12345 123456789  00-000  123456789 


    And here's the error I in return, which makes no sense at all!

    Can you help me please ? :)

    Thank you !

    Thursday, June 30, 2016 2:47 PM


All replies