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; } } }
public static void ToDirectoryAccountExpirationDate(string extendedAttribute, string[] directoryAttributes, ADPropertyValueCollection extendedData, ADEntity directoryObj, CmdletSessionInfo cmdletSessionInfo) { if (extendedData.Count != 0 && extendedData[0] != null) { DateTime item = (DateTime)extendedData[0]; if (item.Ticks != 0x89f7ff5f7b58000L) { AttributeConverters.ToDirectoryDateTime(extendedAttribute, directoryAttributes, extendedData, directoryObj, cmdletSessionInfo); return; } } directoryObj.SetValue(directoryAttributes[0], 0x7fffffffffffffffL); }
internal static void ToExtendedTransportTypeFromDrsOptions(string extendedAttribute, string[] directoryAttributes, ADEntity userObj, ADEntity directoryObj, CmdletSessionInfo cmdletSessionInfo) { bool hasValue; bool flag; AttributeConverters.ToExtendedFlagFromInt(128, false, extendedAttribute, directoryAttributes, userObj, directoryObj, cmdletSessionInfo); bool? value = (bool?)(userObj[extendedAttribute].Value as bool?); bool? nullable = value; if (!nullable.GetValueOrDefault()) { hasValue = false; } else { hasValue = nullable.HasValue; } if (!hasValue) { bool? nullable1 = value; if (nullable1.GetValueOrDefault()) { flag = false; } else { flag = nullable1.HasValue; } if (flag) { userObj.SetValue(extendedAttribute, ADInterSiteTransportProtocolType.IP); } return; } else { userObj.SetValue(extendedAttribute, ADInterSiteTransportProtocolType.SMTP); return; } }