Link to home
Start Free TrialLog in
Avatar of Twhite0909
Twhite0909

asked on

Exchange 2010 Create External Contacts -Import CSV

Ok so I created  CSV with 4 Fields.

ExternalEmailAddress
Name
Firstname
LastName

I entered in eahc users info into theose fields and saved the file ads a CSV to my root of : on exhcnage and called it VertedaExternals.CSV

I ran this cmd

Import-Csv .\VertedaExternal.csv| ForEach {New-MailContact -Name $_.Name -DisplayName $_.Name -ExternalEmailAd
dress $_.ExternalEmailAddress -FirstName $_.FirstName -LastName $_.LastName}

it errros with ALOT of stuff saying it

New-MailContact : Missing an argument for parameter 'ExternalEmailAddress'. Specify a parameter of type 'System.Object'
 and try again.
At line:1 char:111
+ Import-Csv .\VertedaExternal.csv| ForEach {New-MailContact -Name $_.Name -DisplayName $_.Name -ExternalEmailAd <<<<
    + CategoryInfo          : InvalidArgument: (:) [New-MailContact], ParameterBindingException
    + FullyQualifiedErrorId : MissingArgument,New-MailContact

The term 'dress' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spell
ing of the name, or if a path was included, verify that the path is correct and try again.
At line:2 char:6
+ dress <<<<  $_.ExternalEmailAddress -FirstName $_.FirstName -LastName $_.LastName}
    + CategoryInfo          : ObjectNotFound: (dress:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException



Here is an exmaple line of the csv

ExternalEmailAddress      Name      FirstName      LastName
user.last@verteda.com      User, Last      User       last
Avatar of Joseph Daly
Joseph Daly
Flag of United States of America image

This right here makes me think you have a line break or carriage return somwhere in your code.

The term 'dress' is not recognized as the name of a cmdlet, function, script file, or operable program.

Make sure you dont have wordwrap on and make sure that your command is all on one line
ASKER CERTIFIED SOLUTION
Avatar of Joseph Daly
Joseph Daly
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Twhite0909
Twhite0909

ASKER

Actually lets make it easier lol

Ive attached a snapshot of what my CSv looks likes.  Using this CSV what cmd do I need to run to create these contacts?

TY
CSVpic.PNG
See my comment above. It looks like your code has a break in it. The command should be all on one line.