private static bool LoadAcceptedDomain(ExSearchResultEntry entry, Connection sourceConnection, TargetConnection targetConnection, object state)
        {
            EhfConfigTargetConnection ehfConfigTargetConnection = (EhfConfigTargetConnection)targetConnection;

            if (!EhfSynchronizer.LoadFullEntry(entry, EhfDomainSynchronizer.AcceptedDomainAllAttributes, ehfConfigTargetConnection))
            {
                return(false);
            }
            if (!EhfDomainSynchronizer.ValidateDomainName(entry, ehfConfigTargetConnection.DiagSession))
            {
                return(false);
            }
            string configUnitDN = null;

            if (!EhfDomainSynchronizer.TryGetConfigUnit(entry, ehfConfigTargetConnection.DiagSession, out configUnitDN))
            {
                return(false);
            }
            EhfCompanyIdentity ehfCompanyIdentity;

            if (!ehfConfigTargetConnection.TryGetEhfCompanyIdentity(configUnitDN, "ignoring the object", out ehfCompanyIdentity))
            {
                return(false);
            }
            EhfDomainSynchronizer.AddAttributeToChangeEntry(entry, "msExchTenantPerimeterSettingsOrgID", ehfCompanyIdentity.EhfCompanyId.ToString());
            EhfDomainSynchronizer.AddAttributeToChangeEntry(entry, "msEdgeSyncEhfCompanyGuid", ehfCompanyIdentity.EhfCompanyGuid.ToString());
            return(true);
        }
Exemple #2
0
 private bool TryGetTenantOrgUnitDNForChange(ExSearchResultEntry entry, out string tenantOU, out bool isOrgChange, ref bool fullLoadComplete)
 {
     tenantOU    = null;
     isOrgChange = false;
     if (entry.IsDeleted)
     {
         if (!entry.Attributes.ContainsKey("msExchOURoot"))
         {
             if (!EhfSynchronizer.LoadFullEntry(entry, EhfAdminAccountSynchronizer.AdminSyncAllAttributes, base.EhfConnection))
             {
                 return(false);
             }
             fullLoadComplete = true;
         }
         else
         {
             base.DiagSession.LogAndTraceInfo(EdgeSyncLoggingLevel.Low, "Delete change <{0}> already contains OURoot. Using that.", new object[]
             {
                 entry.DistinguishedName
             });
         }
         if (!EhfAdminAccountSynchronizer.TryGetOrganizationUnit(entry, base.DiagSession, out tenantOU))
         {
             base.DiagSession.LogAndTraceError("Could not extract OURoot attribute from deleted change entry <{0}>. Ignoring the change.", new object[]
             {
                 entry.DistinguishedName
             });
             return(false);
         }
         base.DiagSession.LogAndTraceInfo(EdgeSyncLoggingLevel.Low, "Extracted the OURoot <{0}> for the deleted change from the change entry <{1}>", new object[]
         {
             tenantOU,
             entry.DistinguishedName
         });
     }
     else if (!EhfAdminAccountSynchronizer.TryGetOURootFromDN(entry.DistinguishedName, out tenantOU, out isOrgChange))
     {
         base.DiagSession.LogAndTraceError("Failed to get the OrganizationUnit Root from the DN of <{0}>. Ignoring the item.", new object[]
         {
             entry.DistinguishedName
         });
         return(false);
     }
     if (string.IsNullOrEmpty(tenantOU))
     {
         base.DiagSession.LogAndTraceError("OrganizationUnit DN for <{0}> is null or emtpy. Ignoring the item.", new object[]
         {
             entry.DistinguishedName
         });
         return(false);
     }
     if (ExSearchResultEntry.IsDeletedDN(tenantOU))
     {
         base.DiagSession.LogAndTraceInfo(EdgeSyncLoggingLevel.Medium, "Change <{0}> is for a deleted organization <{1}>. Ignoring the item", new object[]
         {
             entry.DistinguishedName,
             tenantOU
         });
         return(false);
     }
     return(true);
 }
Exemple #3
0
        public bool FilterOrLoadFullEntry(ExSearchResultEntry entry)
        {
            bool   flag = false;
            string tenantOU;
            bool   isOrgChange;

            return(this.TryGetTenantOrgUnitDNForChange(entry, out tenantOU, out isOrgChange, ref flag) && !this.IgnoreChange(entry, tenantOU, isOrgChange, ref flag) && (flag || EhfSynchronizer.LoadFullEntry(entry, EhfAdminAccountSynchronizer.AdminSyncAllAttributes, base.EhfConnection)));
        }
Exemple #4
0
 private static bool LoadPerimeterSettings(ExSearchResultEntry entry, Connection sourceConnection, TargetConnection targetConnection, object state)
 {
     return(EhfSynchronizer.LoadFullEntry(entry, EhfCompanySynchronizer.PerimeterSettingsAllAttributes, (EhfTargetConnection)targetConnection));
 }