Leonardo Storelli
asked on
iMPORT-CSV ERROR
Hi
i'm trying to import new mail contact from .csv file, by this command in exchange 2010 powershell
Import-Csv c:\name.csv | foreach {new-mailcontact -name $_.name -externalemailaddress $_.emailaddress;set-contac t –Alias $_.alias -identity $_.name -office $_.office -department $_.department}
but the system returns the following error:
[PS] C:\>Import-Csv c:\name.csv | foreach {new-mailcontact -name $_.name -externalemailaddress $_.emailaddress;set
-contact -Alias $_.alias -identity $_.name -office $_.office -department $_.department}
The term 'Import-Csv ' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:12
+ Import-Csv <<<< c:\name.csv | foreach {new-mailcontact -name $_.name -externalemailaddress $_.emailaddress;set
-contact -Alias $_.alias -identity $_.name -office $_.office -department $_.department}
+ CategoryInfo : ObjectNotFound: (Import-Csv :String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Any IDEA?
thanks
i'm trying to import new mail contact from .csv file, by this command in exchange 2010 powershell
Import-Csv c:\name.csv | foreach {new-mailcontact -name $_.name -externalemailaddress $_.emailaddress;set-contac
but the system returns the following error:
[PS] C:\>Import-Csv c:\name.csv | foreach {new-mailcontact -name $_.name -externalemailaddress $_.emailaddress;set
-contact -Alias $_.alias -identity $_.name -office $_.office -department $_.department}
The term 'Import-Csv ' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:12
+ Import-Csv <<<< c:\name.csv | foreach {new-mailcontact -name $_.name -externalemailaddress $_.emailaddress;set
-contact -Alias $_.alias -identity $_.name -office $_.office -department $_.department}
+ CategoryInfo : ObjectNotFound: (Import-Csv :String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Any IDEA?
thanks
create a CSV file in the below format. This does not have department and office
name emailaddress alias
Mike Witts Mike.Witts@n.com mike.witts
John Smith John.Smith@n.com john.witts
and try this command and post the result
Try with couple of users first
name emailaddress alias
Mike Witts Mike.Witts@n.com mike.witts
John Smith John.Smith@n.com john.witts
and try this command and post the result
Import-Csv c:\name.csv | foreach {new-mailcontact -name $_.name -externalemailaddress $_.emailaddress –Alias $_.alias}
Try with couple of users first
ASKER
Hi
I created the CSV file in this format:
COLUMN A
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ------
1 Name, emailaddress, Alias, office, department
2 Stephen King, stephen @ king.com, stephenking, press, IT
the result of command
[PS] C:\>new-mailcontact -name "Chris Ashton" -externalemailaddress "Chris@tailspintoys.com" ;set-contact -Alias "ashton" -office "press" -department "IT"
Name Alias RecipientType
---- ----- -------------
Chris Ashton ChrisAshton MailContact
A positional parameter cannot be found that accepts argument 'ashton'.
+ CategoryInfo : InvalidArgument: (:) [Set-Contact], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFoun d,Set-Cont act
I created the CSV file in this format:
COLUMN A
--------------------------
1 Name, emailaddress, Alias, office, department
2 Stephen King, stephen @ king.com, stephenking, press, IT
the result of command
[PS] C:\>new-mailcontact -name "Chris Ashton" -externalemailaddress "Chris@tailspintoys.com" ;set-contact -Alias "ashton" -office "press" -department "IT"
Name Alias RecipientType
---- ----- -------------
Chris Ashton ChrisAshton MailContact
A positional parameter cannot be found that accepts argument 'ashton'.
+ CategoryInfo : InvalidArgument: (:) [Set-Contact], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFoun
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Paste the line into the console again, but before you hit Enter, edit the line and delete and retype each and every "-".