GJohn32
asked on
Create New-MailContact from a List
Hi everyone.
I need to create Contacts for several users and would like to use Shell. I'm in Exchange 2010.
The command is
Import-CSV "C:\xx\xx\xxx\Test address.csv" | Foreach{New-MailContact -Name $_.Name -ExternalEmailAddress $_.ExternalEmailAddress -Alias $_.Alias -OrganizationalUnit "xx/xx/xx"}
This is the error
Cannont bind argument to parameter 'External EmailAddress' because it is null.
The .CSV file column headers are:
Name, External Address, and Alias
I'm not sure what is causing the error. I've checked for extra spaces, changed the header from External Address to SMTP
I need to create Contacts for several users and would like to use Shell. I'm in Exchange 2010.
The command is
Import-CSV "C:\xx\xx\xxx\Test address.csv" | Foreach{New-MailContact -Name $_.Name -ExternalEmailAddress $_.ExternalEmailAddress -Alias $_.Alias -OrganizationalUnit "xx/xx/xx"}
This is the error
Cannont bind argument to parameter 'External EmailAddress' because it is null.
The .CSV file column headers are:
Name, External Address, and Alias
I'm not sure what is causing the error. I've checked for extra spaces, changed the header from External Address to SMTP
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
By the way, the $_.ExternalEmailAddress in the command doesn't match the CSV column header you listed.
ASKER
Thank you thank you Thank you
I changed the Header to ExternalEmailAddress without any spaces.
The External email address are pager numbers and I forgot to remove the dashes between the numbers. So now the ExternalEmailAddress are displayed as 1234567890@txt.att.net.
I changed the Header to ExternalEmailAddress without any spaces.
The External email address are pager numbers and I forgot to remove the dashes between the numbers. So now the ExternalEmailAddress are displayed as 1234567890@txt.att.net.