Bulk importing contacts from CSV to Exchange 2007 for other fields
I have this command:
Import-Csv test.csv | ForEach { New-MailContact -Firstname $_.FirstName -LastName $_.LastName -ExternalEmailAddress $_.EmailAddress -City $_.City -State $_.State -Office $_.Office -Title $_.Title -Department $_.Department -Company $_.Company -Telephone $_.Telephone
-OrganizationalUnit "temp.com/test" }
Obviously it doesn't work. I have 20,000 contacts to import and need to import all of the fields.
These are the fields: FirstName, LastName, EmailAddress, City, State, Office, Title, Department, Company, Telephone, OrganizationalUnit
Some of them are correct but it's crapping out on City, I'm assuming it's going to fail on the rest of the fields after that as well. I can't find what the syntax should be and not even sure if all of these fields are available. Anyone know?
April 11th, 2012 7:41pm
Try the method from the following article. a very detailed step by step approach
http://www.discoposse.com/index.php/2012/02/10/importing-and-updating-exchange-2010-contacts-from-csv/
Free Windows Admin Tool Kit Click here and download it now
April 12th, 2012 12:05am
Hi
In your script, it missed a very important Parameter which is Required, This Parameter is "Name", you could refer to the below link
http://technet.microsoft.com/en-us/library/bb124519.aspx
There are two Parameters must include in New-MailContact CMDLET, "Name" and "ExternalEmailAddress", we can not miss any one.
You can add the name field in your CSV file and Add "-Name $_.Name" in your command
Cheers
Zi FengZi Feng
TechNet Community Support
April 13th, 2012 6:29am
It looks like you also miss out the -Alias $_.Alias and -Name $_.Name.
Give that a go and let us know if you are still have the issue.
Free Windows Admin Tool Kit Click here and download it now
April 13th, 2012 12:08pm
Alias is optional.
April 28th, 2012 12:10pm
Hi
In your script, it missed a very important Parameter which is Required, This Parameter is "Name", you could refer to the below link
http://technet.microsoft.com/en-us/library/bb124519.aspx
There are two Parameters must include in New-MailContact CMDLET, "Name" and "ExternalEmailAddress", we can not miss any one.
You can add the name field in your CSV file and Add "-Name $_.Name" in your command
Cheers
Zi FengZi Feng
TechNet Community Support
Free Windows Admin Tool Kit Click here and download it now
April 28th, 2012 11:20pm
It looks like you also miss out the -Alias $_.Alias and -Name $_.Name.
Give that a good and let us know if you are still have the issue.
April 29th, 2012 4:59am