Пример #1
0
        internal static void ToExtendedAttributeMetadataValue(string extendedAttribute, string[] directoryAttributes, ADEntity userObj, ADEntity directoryObj, CmdletSessionInfo cmdletSessionInfo)
        {
            string value = directoryObj["sourceXmlAttribute"].Value as string;

            if (!string.Equals("msDS-ReplAttributeMetaData", value, StringComparison.OrdinalIgnoreCase))
            {
                if (string.Equals("msDS-ReplValueMetaData", value, StringComparison.OrdinalIgnoreCase))
                {
                    AttributeConverters.ToExtendedObject(extendedAttribute, directoryAttributes, userObj, directoryObj, cmdletSessionInfo);
                }
                return;
            }
            else
            {
                string str = directoryObj["pszAttributeName"].Value as string;
                if (string.IsNullOrEmpty(str))
                {
                    userObj.SetValue(extendedAttribute, null);
                    return;
                }
                else
                {
                    userObj.SetValue(extendedAttribute, directoryObj[str]);
                    return;
                }
            }
        }