internal override T GetExtendedObjectFromIdentity(T identityObj, string identityQueryPath, ICollection <string> propertiesToFetch, bool showDeleted) { if (base.CmdletSessionInfo != null) { MappingTable <AttributeConverterEntry> item = ADNtdsSiteSettingFactory <ADNtdsSiteSetting> .AttributeTable[base.ConnectedStore]; MappingTable <AttributeConverterEntry> mappingTable = ADReplicationSiteFactory <T> .AttributeTable[base.ConnectedStore]; ICollection <string> parentAttributes = ADTopologyUtil.GetParentAttributes(mappingTable, item, propertiesToFetch); ICollection <string> childAttributes = ADTopologyUtil.GetChildAttributes(mappingTable, item, propertiesToFetch); T extendedObjectFromIdentity = base.GetExtendedObjectFromIdentity(identityObj, identityQueryPath, parentAttributes, showDeleted); string str = ADPathModule.MakePath(extendedObjectFromIdentity.DistinguishedName, "CN=NTDS Site Settings,", ADPathFormat.X500); try { ADTopologyUtil.ConstructAggregateObject <ADNtdsSiteSettingFactory <ADNtdsSiteSetting>, ADNtdsSiteSetting>(str, extendedObjectFromIdentity, identityQueryPath, childAttributes, showDeleted, base.CmdletSessionInfo); } catch (ADIdentityNotFoundException aDIdentityNotFoundException) { DebugLogger.LogInfo(this._debugCategory, string.Format("ADReplicationSiteFactory: Ntds-Site-Setting object not found for the site {0}, while constructing ADReplicationSite", extendedObjectFromIdentity.DistinguishedName)); } return(extendedObjectFromIdentity); } else { throw new ArgumentNullException(StringResources.SessionRequired); } }
internal override IEnumerable <T> GetExtendedObjectFromFilter(IADOPathNode filter, string searchBase, ADSearchScope searchScope, ICollection <string> propertiesToFetch, int?resultSetSize, int?pageSize, bool showDeleted) { if (base.CmdletSessionInfo != null) { MappingTable <AttributeConverterEntry> item = ADNtdsSiteSettingFactory <ADNtdsSiteSetting> .AttributeTable[base.ConnectedStore]; MappingTable <AttributeConverterEntry> mappingTable = ADReplicationSiteFactory <T> .AttributeTable[base.ConnectedStore]; ICollection <string> parentAttributes = ADTopologyUtil.GetParentAttributes(mappingTable, item, propertiesToFetch); ICollection <string> childAttributes = ADTopologyUtil.GetChildAttributes(mappingTable, item, propertiesToFetch); if (!parentAttributes.Contains("*")) { parentAttributes.Add("*"); } IEnumerable <T> extendedObjectFromFilter = base.GetExtendedObjectFromFilter(this.StructuralObjectFilter, searchBase, searchScope, parentAttributes, resultSetSize, pageSize, showDeleted); ADNtdsSiteSettingFactory <ADNtdsSiteSetting> aDNtdsSiteSettingFactory = new ADNtdsSiteSettingFactory <ADNtdsSiteSetting>(); aDNtdsSiteSettingFactory.SetCmdletSessionInfo(base.CmdletSessionInfo); IEnumerable <ADNtdsSiteSetting> aDNtdsSiteSettings = aDNtdsSiteSettingFactory.GetExtendedObjectFromFilter(aDNtdsSiteSettingFactory.StructuralObjectFilter, searchBase, searchScope, childAttributes, resultSetSize, pageSize, showDeleted); Dictionary <string, ADNtdsSiteSetting> strs = new Dictionary <string, ADNtdsSiteSetting>(); foreach (ADNtdsSiteSetting aDNtdsSiteSetting in aDNtdsSiteSettings) { strs.Add(aDNtdsSiteSetting.DistinguishedName, aDNtdsSiteSetting); } List <T> ts = new List <T>(); foreach (T t in extendedObjectFromFilter) { string str = ADPathModule.MakePath(t.DistinguishedName, "CN=NTDS Site Settings,", ADPathFormat.X500); if (strs.ContainsKey(str)) { ADNtdsSiteSetting item1 = strs[str]; ADTopologyUtil.MergeADObjectProperties(t, item1); } ts.Add(t); } IEnumerable <T> ts1 = this.ApplyClientSideFilter(ts); return(ADTopologyUtil.RemoveExtraPropertiesFromADAggregateObject <T>(mappingTable, item, propertiesToFetch, ts1)); } else { throw new ArgumentNullException(StringResources.SessionRequired); } }