将值加到“;其他“;属性
本文关键字:属性 其他 | 更新日期: 2023-09-27 18:20:25
AD中的某些字段具有用于多个值的选项"other":AD字段屏幕截图
我尝试使用以下代码向该字段添加新值:
if (Domaincontact.Telephones.Faxes != null)
{
foreach (var fax in Domaincontact.Telephones.Faxes)
{
if(activeDirectoryContact.Properties[FAX].Contains(fax)) continue;
activeDirectoryContact.Properties[FAX].Add(fax);
}
}
activeDirectoryContact.CommitChanges();
但在最后一行代码之后有一个异常:
ExtendedErrorMessage = "00002081: AtrErr: DSID-031517FA, #2:'n't0: 00002081: DSID-031517FA, problem 1005 (CONSTRAINT_ATT_TYPE), data 0, Att 17 (facsimileTelephoneNumber)'n't1: 00002081: DSID-031517FA, problem 1005 (CONSTRAINT_ATT_TYPE), data 0, Att 17 (facsimileTelephoneNumber)'n"
AD怎么了;D有人能告诉我我缺了什么吗?
好。我自己想明白了。此处是AD字段描述的链接。在我的场景中,它将是:
otherFacsimileTelephoneNumber
其他:
otherHomePhone
otherIpPhone
otherLoginWorkstations
otherMailbox
otherMobile
otherPager
otherTelephone