在 Active Directory 中向 "Other" 属性 添加值

Add value to "Other" property in Active Directory

AD 中的某些字段有多个值的选项 "other": AD fields screenshot

我尝试使用以下代码向该字段添加新值:

 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 有人可以告诉我我遗漏了什么吗?

好的。我自己想通了。这里的link对AD字段的描述。在我的场景中它将是:

otherFacsimileTelephoneNumber

及其他:

otherHomePhone otherIpPhone otherLoginWorkstations otherMailbox otherMobile otherPager otherTelephone