Example #1
0
        internal static ExchangeAssistance GetExchangeAssistanceObjectFromAD(OrganizationId organizationId)
        {
            ExchangeAssistance result = null;

            try
            {
                IConfigurationSession configurationSession;
                ADObjectId            adobjectId;
                if (organizationId == OrganizationId.ForestWideOrgId)
                {
                    configurationSession = HelpProvider.GetOrganizationConfigurationSession(organizationId);
                    adobjectId           = configurationSession.GetOrgContainerId();
                }
                else
                {
                    SharedConfiguration sharedConfiguration = SharedConfiguration.GetSharedConfiguration(organizationId);
                    if (sharedConfiguration != null)
                    {
                        adobjectId           = sharedConfiguration.SharedConfigurationCU.Id;
                        configurationSession = DirectorySessionFactory.Default.GetTenantOrTopologyConfigurationSession(ConsistencyMode.IgnoreInvalid, sharedConfiguration.GetSharedConfigurationSessionSettings(), 955, "GetExchangeAssistanceObjectFromAD", "f:\\15.00.1497\\sources\\dev\\UA\\src\\HelpProvider\\HelpProvider.cs");
                    }
                    else
                    {
                        adobjectId           = organizationId.ConfigurationUnit;
                        configurationSession = HelpProvider.GetOrganizationConfigurationSession(organizationId);
                    }
                }
                ADObjectId childId = adobjectId.GetChildId("ExchangeAssistance").GetChildId(HelpProvider.CurrentVersionExchangeAssistanceContainerName);
                result = configurationSession.Read <ExchangeAssistance>(childId);
            }
            catch (ADTransientException ex)
            {
                ExTraceGlobals.CoreTracer.TraceDebug <string>(0L, "ADTransient Exception in LoadBaseURL: {0}", ex.Message);
            }
            catch (ADOperationException ex2)
            {
                ExTraceGlobals.CoreTracer.TraceDebug <string>(0L, "ADOperationException in LoadBaseURL: {0}", ex2.Message);
            }
            return(result);
        }