Z
Z
Z-RoVeR2018-08-06 16:46:50
PowerShell
Z-RoVeR, 2018-08-06 16:46:50

Import mail contacts from csv file to AD. What is the problem?

There is a script through which I export mail contacts from a csv file:

Import-CSV -Path "C:\tmp\users.csv" -Delimiter ";" | ForEach-Object -process {New-ADObject -Path "OU=*,OU=*,DC=domain,DC=local" -Name $_.Name -Type Contact -DisplayName $_.Name -OtherAttributes @{'givenname' =$_.givenname; 'mail'=$_.emailaddress; 'proxyAddresses'=$_.smtp; 'targetAddress'=$_.smtp; 'mailNickname'=$_.Surname; 'sn'=$_.SurName;}}

The script runs without errors, contacts are created in AD, but if you go to ecp exchange and open the created contact, an error occurs: 5b685053b7205291214248.png
A mailbox is created in the email settings, but the main mailbox remains empty: 5b68509f55999998455154.png
What could be the reason?
The mail contact domain is different from ours.
exchange version - 2016

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2018-08-06
@Z-RoVeR

I export like this
And I import like this
contacts.txt file is csv actually

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question