Hi,
The following script
$Path =
'C:\csv\contacts.csv'
Import-Csv
$Path|ForEach-Object {New-ADObject-TypeContact-Path"OU=Contacts,OU=WLB,DC=Domain,DC=local"-Name"$_.DisplayName"-OtherAttributes @{'mail'=$_.ExternalEmailAddress;}}
Procuces the error below. Can someone please tell whats wrong with this
Many thanks
New-ADObject : Cannot bind parameter 'OtherAttributes' to the target. Exception setting "OtherAttributes": "Object reference not set to an instance of an object." At C:\Script\contacts.ps1:4 char:150 + ... therAttributes @{'mail'=$_.ExternalEmailAddress;}}