0

I'm trying to add two different external email addresses for the contacts in the Active Directory. I'm facing the following COMException: A constraint violation occurred.

Here is the DirectoryEntry path= "LDAP://CN=s0010109,OU=RSVContacts,DC=domain,DC=com"

Here is the code :

DirectoryEntry entryAD = new DirectoryEntry("LDAP://CN=s0010109,OU=RSVContacts,DC=domain,DC=com");    

DirectorySearcher myADSearcher = new DirectorySearcher(entryAD);
                SearchResultCollection resultAD = myADSearcher.FindAll();              

entryAD.Properties["targetaddress"].Value = new string[] { "SMTP:" + "[email protected]", ""SMTP:" + [email protected]"};  //;
entryAD.CommitChanges();

1 Answer 1

0

Like what I said in my answer on your previous question, targetAddress is not a multi-value attribute. You cannot do that. You can only have one single value stored in this attribute.

2
  • Any idea on how I can add multiple external email addresses to a Contact in Active Directory Feb 21, 2011 at 18:46
  • @Free Styler, I am not an Exchange expert but on AD, you can only specify one single string to targetAddress. This is controlled by AD schema. I googled and found people are using distribution group to forward emails to multiple addresses. Hope this help. forums.msexchange.org/m_1800424605/mpage_1/key_/… Feb 21, 2011 at 20:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.