Windows Vista Forums

importing new Mail Contact in to exchange2007
  1. #1


    will gerrish Guest

    importing new Mail Contact in to exchange2007

    Hi there,

    im pretty new to PS and im wondering if someone can help point out where i
    am going wrong. im trying to import a list of mail contacts that are in a
    CSV file in to Exchange 2007 via powershell but im having now luck. below is
    my command and my CSV file

    Import-Csv c:\csv\book1.csv | ForEach { New-MailContact -Name $_.displayName
    -Firstname $_.FirstName -LastName $_.LastName -ExternalEmailAddress
    $_.Emailaddress -OrganizationalUnit
    "OU=Contacts,OU=Groups,OU=London,DC=City,DC=DOMAIN,DC=com"

    >>
    DisplayNameFirstNameLastName EmailaddressOrganizationalUnit
    Ted (easons)TedSmithted.smith@xxxxxx
    OU=Contacts,OU=Groups,OU=London,DC=city,DC=DOMAIN,DC=com

    when i enter the command in to PS it just sits there and doesnt even come
    back with an error.



    im sure this is a simple problem but any help is much appreciated.

    thanks

    will

      My System SpecsSystem Spec

  2. #2


    Shay Levy [MVP] Guest

    Re: importing new Mail Contact in to exchange2007

    Hello will,

    The command looks ok but the csv file is not, column names (and values) should
    be seperated by a comma.
    If the value has spaces in it, enclose it with quetes (e.g "value"), wrap
    the ou value too (it contains comma characters which can confuse the cmdlet),
    here's a sample:

    displayName,FirstName,LastName,Emailaddress,OrganizationalUnit
    con1,con1First,con1Last,con1@xxxxxx,"OU=Contacts,OU=Groups,OU=London,DC=city,DC=DOMAIN,DC=com"


    You can verify the csv file content by watching the output of:

    Import-Csv c:\csv\book1.csv




    ---
    Shay Levy
    Windows PowerShell MVP
    http://blogs.microsoft.co.il/blogs/ScriptFanatic
    PowerShell Toolbar: http://tinyurl.com/PSToolbar


    wg> Hi there,
    wg>
    wg> im pretty new to PS and im wondering if someone can help point out
    wg> where i am going wrong. im trying to import a list of mail contacts
    wg> that are in a CSV file in to Exchange 2007 via powershell but im
    wg> having now luck. below is my command and my CSV file
    wg>
    wg> Import-Csv c:\csv\book1.csv | ForEach { New-MailContact -Name
    wg> $_.displayName -Firstname $_.FirstName -LastName $_.LastName
    wg> -ExternalEmailAddress $_.Emailaddress -OrganizationalUnit
    wg> "OU=Contacts,OU=Groups,OU=London,DC=City,DC=DOMAIN,DC=com"
    wg>
    wg> DisplayNameFirstNameLastName EmailaddressOrganizationalUnit Ted
    wg> (easons)TedSmithted.smith@xxxxxx
    wg> OU=Contacts,OU=Groups,OU=London,DC=city,DC=DOMAIN,DC=com
    wg>
    wg> when i enter the command in to PS it just sits there and doesnt even
    wg> come back with an error.
    wg>
    wg> im sure this is a simple problem but any help is much appreciated.
    wg>
    wg> thanks
    wg>
    wg> will
    wg>



      My System SpecsSystem Spec

importing new Mail Contact in to exchange2007 problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing Contact list in WLM 2009 Rage Skywolfe Live Messenger 2 14 Jun 2009
Importing Contact Lists Into Windows Live Mail Beta D. Spencer Hines Live Mail 4 28 Sep 2008
Problem with importing contact list Floyd Vista mail 1 23 Sep 2007
importing contact error dave Vista mail 3 04 Aug 2007
importing into a contact group Krista Vista mail 0 02 Apr 2007