/// <summary> /// Method validates the requirements under LDSCrossRefContainer Scenario. /// </summary> public void ValidateLDSCrossRefContainer() { DirectoryEntry dirPartitions = new DirectoryEntry(); DirectoryEntry domainEntry = new DirectoryEntry(); DirectoryEntry childEntry = new DirectoryEntry(); DirectoryEntry requiredEntry = new DirectoryEntry(); string systemFlag; int systemFlagVal; //Variables for holding the paths for NCs. if (!adAdapter.GetLdsObjectByDN("CN=Partitions,CN=Configuration," + adAdapter.LDSRootObjectName, out dirPartitions)) { DataSchemaSite.Assert.IsTrue( false, "CN=Partitions,CN=Configuration," + adAdapter.LDSRootObjectName + "Object is not found in server"); } string parentAttribute = dirPartitions.Parent.Name.ToString(); //MS-ADTS-Schema_R402 DataSchemaSite.CaptureRequirementIfAreEqual <string>( "CN=Configuration", parentAttribute, 402, "The Parent of the Cross-Ref-Container Container must be Config NC root."); //MS-ADTS-Schema_R403 DataSchemaSite.CaptureRequirementIfAreEqual <string>( "Partitions", dirPartitions.Properties["name"].Value.ToString(), 403, "The name attribute of the Cross-Ref-Container Container must be Partitions."); PropertyValueCollection objectClass = dirPartitions.Properties["objectClass"]; //MS-ADTS-Schema_R404 DataSchemaSite.CaptureRequirementIfIsTrue( objectClass.Contains((object)"crossRefContainer"), 404, "The objectClass attribute of the Cross-Ref-Container Container must be crossRefContainer."); //MS-ADTS-Schema_R406 systemFlag = dirPartitions.Properties["systemFlags"].Value.ToString(); systemFlagVal = ParseSystemFlagsValue("FLAG_DISALLOW_DELETE"); DataSchemaSite.CaptureRequirementIfAreEqual <string>( systemFlagVal.ToString(), systemFlag, 406, "The systemFlags attribute of the Cross-Ref-Container Container must be FLAG_DISALLOW_DELETE."); bool isCrossRef = true; bool isObjectClassCrossRef = true; DirectoryEntries Childs = dirPartitions.Children; foreach (DirectoryEntry child in Childs) { if (!child.Parent.Name.Equals("CN=Partitions")) { isCrossRef = false; } PropertyValueCollection objClass = child.Properties["objectClass"]; objClass.RemoveAt(0); if (objClass.Count != 1 || !objClass.Contains((object)"crossRef")) { isObjectClassCrossRef = false; } } //MS-ADTS-Schema_R408 DataSchemaSite.CaptureRequirementIfIsTrue( isCrossRef, 408, "The parent of the Cross-Ref Objects must be crossRefContainer object."); //MS-ADTS-Schema_R409 DataSchemaSite.CaptureRequirementIfIsTrue( isObjectClassCrossRef, 409, "The objectClass attribute of the Cross-Ref Objects must be crossRef."); childEntry = dirPartitions.Children.Find("CN=Enterprise Configuration"); //MS-ADTS-Schema_R410 DataSchemaSite.CaptureRequirementIfAreEqual <string>( "CN=Configuration," + adAdapter.LDSRootObjectName, childEntry.Properties["nCName"].Value.ToString(), 410, "The nCName attribute of the Configuration crossRef Object must equal to the config NC root."); //MS-ADTS-Schema_R412 DataSchemaSite.CaptureRequirementIfIsFalse( childEntry.Properties.Contains("dnsRoot"), 412, "In AD/LDS the dnsroot attribute is not presented for the Configuration crossRef Object. "); childEntry = dirPartitions.Children.Find("CN=Enterprise Schema"); //MS-ADTS-Schema_R413 DataSchemaSite.CaptureRequirementIfAreEqual <string>( "CN=Schema,CN=Configuration," + adAdapter.LDSRootObjectName, childEntry.Properties["nCName"].Value.ToString(), 413, "The nCName attribute of the Schema crossRef Object must equal to the Schema NC root."); //MS-ADTS-Schema_R415 DataSchemaSite.CaptureRequirementIfIsFalse( childEntry.Properties.Contains("dnsRoot"), 415, "In AD/LDS the dnsroot attribute is not presented for the Schema crossRef Object."); childEntry = dirPartitions.Children.Find("CN=Enterprise Configuration"); //MS-ADTS-Schema_R421 DataSchemaSite.CaptureRequirementIfIsFalse( childEntry.Properties.Contains("dnsRoot"), 421, "In AD/LDS the dnsroot attribute is not presented for Application NC crossRef Object."); //MS-ADTS-Schema_R852 childEntry = dirPartitions.Children.Find("CN=Enterprise Schema"); if (!adAdapter.GetLdsObjectByDN("CN=Schema,CN=Configuration," + adAdapter.LDSRootObjectName, out dirPartitions)) { DataSchemaSite.Assert.IsTrue( false, "CN=Schema,CN=Configuration," + adAdapter.LDSRootObjectName + " Object is not found in server"); } DataSchemaSite.CaptureRequirementIfAreEqual <string>( childEntry.Properties["nCName"].Value.ToString(), dirPartitions.Properties["distinguishedName"].Value.ToString(), 852, "The nCName attribute of the crossRef object must equal the dsname of the NC root object."); }