开发者

Active Directory: unable to add multiple email addresses in multi valued property ("targetaddress")

开发者 https://www.devze.com 2023-02-12 03:47 出处:网络
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.

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")开发者_如何学Go;    

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

entryAD.Properties["targetaddress"].Value = new string[] { "SMTP:" + "firstemail@abc.com", ""SMTP:" + secondemail@mail.com"};  //;
entryAD.CommitChanges();


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消