diff --git a/src/Producers/BaseProducer.cs b/src/Producers/BaseProducer.cs index 7854fabf..4984c2df 100644 --- a/src/Producers/BaseProducer.cs +++ b/src/Producers/BaseProducer.cs @@ -76,7 +76,7 @@ protected LDAPData CreateLDAPData() { if ((methods & ResolvedCollectionMethod.Container) != 0) { - query = query.AddContainers().AddDomains(); + query = query.AddComputers().AddContainers().AddUsers().AddGroups().AddDomains().AddOUs().AddGPOs(); props.AddRange(CommonProperties.ContainerProps); } diff --git a/src/Runtime/ObjectProcessors.cs b/src/Runtime/ObjectProcessors.cs index 3282a689..f20e16b7 100644 --- a/src/Runtime/ObjectProcessors.cs +++ b/src/Runtime/ObjectProcessors.cs @@ -135,6 +135,11 @@ private async Task ProcessUserObject(ISearchResultEntry entry, ret.SPNTargets = targets.ToArray(); } + if ((_methods & ResolvedCollectionMethod.Container) != 0) + { + ret.ContainedBy = _containerProcessor.GetContainingObject(entry.DistinguishedName); + } + return ret; } @@ -183,6 +188,11 @@ private async Task ProcessComputerObject(ISearchResultEntry entry, ret.DumpSMSAPassword = computerProps.DumpSMSAPassword; } + if ((_methods & ResolvedCollectionMethod.Container) != 0) + { + ret.ContainedBy = _containerProcessor.GetContainingObject(entry.DistinguishedName); + } + if (!_methods.IsComputerCollectionSet()) return ret; @@ -306,6 +316,11 @@ private Group ProcessGroupObject(ISearchResultEntry entry, } } + if ((_methods & ResolvedCollectionMethod.Container) != 0) + { + ret.ContainedBy = _containerProcessor.GetContainingObject(entry.DistinguishedName); + } + return ret; } @@ -368,7 +383,6 @@ private async Task ProcessDomainObject(ISearchResultEntry entry, if ((_methods & ResolvedCollectionMethod.Container) != 0) { - ret.ChildObjects = _containerProcessor.GetContainerChildObjects(resolvedSearchResult, entry).ToArray(); ret.Links = _containerProcessor.ReadContainerGPLinks(resolvedSearchResult, entry).ToArray(); } @@ -410,7 +424,6 @@ private GPO ProcessGPOObject(ISearchResultEntry entry, ret.Properties); } } - return ret; } @@ -447,7 +460,7 @@ private async Task ProcessOUObject(ISearchResultEntry entry, if ((_methods & ResolvedCollectionMethod.Container) != 0) { - ret.ChildObjects = _containerProcessor.GetContainerChildObjects(resolvedSearchResult, entry).ToArray(); + ret.ContainedBy = _containerProcessor.GetContainingObject(entry.DistinguishedName); ret.Properties.Add("blocksinheritance", ContainerProcessor.ReadBlocksInheritance(entry.GetProperty("gpoptions"))); ret.Links = _containerProcessor.ReadContainerGPLinks(resolvedSearchResult, entry).ToArray(); @@ -477,7 +490,7 @@ private Container ProcessContainerObject(ISearchResultEntry entry, ret.Properties.Add("highvalue", false); if ((_methods & ResolvedCollectionMethod.Container) != 0) - ret.ChildObjects = _containerProcessor.GetContainerChildObjects(entry.DistinguishedName).ToArray(); + ret.ContainedBy = _containerProcessor.GetContainingObject(entry.DistinguishedName); if ((_methods & ResolvedCollectionMethod.ACL) != 0) { diff --git a/src/Writers/JsonDataWriter.cs b/src/Writers/JsonDataWriter.cs index 821c9afd..8698aacb 100644 --- a/src/Writers/JsonDataWriter.cs +++ b/src/Writers/JsonDataWriter.cs @@ -22,7 +22,7 @@ public class JsonDataWriter : BaseWriter private string _fileName; private JsonSerializerSettings _serializerSettings; - private const int DataVersion = 5; + private const int DataVersion = 6; /// /// Creates a new instance of a JSONWriter using the specified datatype and program context