EMS add X.500
- This topic has 2 replies, 2 voices, and was last updated 9 years, 6 months ago by .
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
You must be logged in to reply to this topic.
Home › Forums › Scripting › PowerShell › EMS add X.500
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
You must be logged in to reply to this topic.
Find out more about our cookie policy here.