EMS add X.500

Home Forums Scripting PowerShell EMS add X.500

Viewing 1 post (of 1 total)
  • Author
    Posts
  • Avatar
    Semperfi4000
    Member
    #155630

    I am hoping someone may be able to help me figure, why the following will not work.. I am trying to add an X.500 address to a list of users that are in a CSV file.

    import-csv c:tempContactUsers.csv | foreach {$temp = Get-mailContact -identity $_.Name $temp.EmailAddresses += “x500:” + $_.legacyexchangedn Set-mailcontact -instance $temp}

    I get the error:

    Get-MailContact : A positional parameter cannot be foudn that accepts argument ‘Microsoft.Exchange.Data.ProxyAddressesCollection’
    At line:1 char:70

    However, If I manaully run the following it works.

    $Temp = Get-mailContact -identity “John Doe”
    $temp.EmailAddresses += “x500:” + “/O=MyDomain/OU=FIRST ADMINISTRATIVE GROUP/CN=RECIPIENTS/CN=Jdoe”
    Set-MailContact -instance $temp

    This is an example of my CSV file:

    name,legacyexchangedn
    John Doe,/O=myDomain/OU=FIRST ADMINISTRATIVE GROUP/CN=RECIPIENTS/CN=JDoe
    Mary Doe,/O=myDomain/OU=FIRST ADMINISTRATIVE GROUP/CN=RECIPIENTS/CN=MDoe

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.