private static void OnExchangeAssiatnceConfigChanged(ADNotificationEventArgs args) { ExchangeAssistance exchangeAssistanceObjectFromADWithRetry = HelpProvider.GetExchangeAssistanceObjectFromADWithRetry(OrganizationId.ForestWideOrgId); if (exchangeAssistanceObjectFromADWithRetry != null) { switch (HelpProvider.callingAppName) { case HelpProvider.HelpAppName.Ecp: if (exchangeAssistanceObjectFromADWithRetry.ControlPanelHelpURL != null) { Interlocked.Exchange <Uri>(ref HelpProvider.baseUrl, Utilities.NormalizeUrl(exchangeAssistanceObjectFromADWithRetry.ControlPanelHelpURL)); return; } break; case HelpProvider.HelpAppName.Owa: if (exchangeAssistanceObjectFromADWithRetry.OWAHelpURL != null) { Interlocked.Exchange <Uri>(ref HelpProvider.baseOwaPremiumUrl, exchangeAssistanceObjectFromADWithRetry.OWAHelpURL); } if (exchangeAssistanceObjectFromADWithRetry.OWALightHelpURL != null) { Interlocked.Exchange <Uri>(ref HelpProvider.baseOwaLightUrl, exchangeAssistanceObjectFromADWithRetry.OWALightHelpURL); } break; default: return; } } }
private static ExchangeAssistance GetExchangeAssistanceObjectFromADWithRetry(OrganizationId organizationId) { int num = 0; ExchangeAssistance exchangeAssistance = null; while (exchangeAssistance == null && num < 6) { exchangeAssistance = HelpProvider.GetExchangeAssistanceObjectFromAD(organizationId); if (exchangeAssistance == null) { num++; Thread.Sleep(10000); } } return(exchangeAssistance); }
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); }
protected override HelpProviderCache.Item CreateOnCacheMiss(OrganizationId key, ref bool shouldAdd) { shouldAdd = true; ExchangeAssistance exchangeAssistanceObjectFromAD = HelpProvider.GetExchangeAssistanceObjectFromAD(key); Uri privacyStatementUrl = null; Uri communityUrl = null; bool?privacyLinkDisplayEnabled = null; if (exchangeAssistanceObjectFromAD != null) { if (exchangeAssistanceObjectFromAD.CommunityLinkDisplayEnabled) { communityUrl = exchangeAssistanceObjectFromAD.CommunityURL; } privacyLinkDisplayEnabled = new bool?(exchangeAssistanceObjectFromAD.PrivacyLinkDisplayEnabled); if (exchangeAssistanceObjectFromAD.PrivacyLinkDisplayEnabled) { privacyStatementUrl = exchangeAssistanceObjectFromAD.PrivacyStatementURL; } } return(new HelpProviderCache.Item(privacyStatementUrl, communityUrl, privacyLinkDisplayEnabled)); }
private static void LoadBaseUrlViaCmdlet(HelpProvider.HelpAppName appName, RunspaceServerSettingsPresentationObject runspaceServerSettings, MonadConnectionInfo monadConnectionInfo) { if (appName != HelpProvider.HelpAppName.Toolbox) { if (appName != HelpProvider.HelpAppName.Eap) { throw new InvalidOperationException("appName is not a valid HelpAppName enum. Check caller of Initialize how we get this value."); } } try { ExchangeAssistance exchangeAssistance = null; MonadConnection connection = new MonadConnection("timeout=30", new CommandInteractionHandler(), runspaceServerSettings, monadConnectionInfo); using (new OpenConnection(connection)) { using (MonadCommand monadCommand = new MonadCommand("Get-ExchangeAssistanceConfig", connection)) { object[] array = monadCommand.Execute(); if (array != null && array.Length != 0) { exchangeAssistance = (array[0] as ExchangeAssistance); } } } if (exchangeAssistance != null) { if (exchangeAssistance.ManagementConsoleHelpURL != null) { HelpProvider.baseUrl = Utilities.NormalizeUrl(exchangeAssistance.ManagementConsoleHelpURL); } if (exchangeAssistance.ManagementConsoleFeedbackEnabled) { HelpProvider.managementConsoleFeedbackUrl = exchangeAssistance.ManagementConsoleFeedbackURL; } else { HelpProvider.managementConsoleFeedbackUrl = null; } if (exchangeAssistance.PrivacyLinkDisplayEnabled) { HelpProvider.privacyStatementUrl = exchangeAssistance.PrivacyStatementURL; } else { HelpProvider.privacyStatementUrl = null; } if (exchangeAssistance.WindowsLiveAccountURLEnabled) { HelpProvider.windowsLiveAccountUrl = exchangeAssistance.WindowsLiveAccountPageURL; } else { HelpProvider.windowsLiveAccountUrl = null; } if (exchangeAssistance.CommunityLinkDisplayEnabled) { HelpProvider.communityUrl = exchangeAssistance.CommunityURL; } else { HelpProvider.communityUrl = null; } } } catch (CommandExecutionException ex) { ExTraceGlobals.CoreTracer.TraceDebug <string>(0L, "CommandExecution Exception in LoadBaseURL: {0}", ex.Message); } catch (CmdletInvocationException ex2) { ExTraceGlobals.CoreTracer.TraceDebug <string>(0L, "CmdletInvocationException Exception in LoadBaseURL: {0}", ex2.Message); } catch (PipelineStoppedException ex3) { ExTraceGlobals.CoreTracer.TraceDebug <string>(0L, "PipelineStopped Exception in LoadBaseURL: {0}", ex3.Message); } HelpProvider.callingAppName = appName; }
private static void LoadBaseUrlViaADSession(HelpProvider.HelpAppName appName) { ExchangeAssistance exchangeAssistanceObjectFromAD = HelpProvider.GetExchangeAssistanceObjectFromAD(OrganizationId.ForestWideOrgId); if (exchangeAssistanceObjectFromAD != null) { HelpProvider.RegisterChangeNotification(exchangeAssistanceObjectFromAD.Id); if (appName.Equals(HelpProvider.HelpAppName.Ecp) || appName.Equals(HelpProvider.HelpAppName.TenantMonitoring)) { if (exchangeAssistanceObjectFromAD.ControlPanelHelpURL != null) { HelpProvider.baseUrl = Utilities.NormalizeUrl(exchangeAssistanceObjectFromAD.ControlPanelHelpURL); } if (exchangeAssistanceObjectFromAD.ControlPanelFeedbackEnabled) { HelpProvider.controlPanelFeedbackUrl = exchangeAssistanceObjectFromAD.ControlPanelFeedbackURL; } else { HelpProvider.controlPanelFeedbackUrl = null; } } else if (appName.Equals(HelpProvider.HelpAppName.Owa)) { if (exchangeAssistanceObjectFromAD.OWALightHelpURL != null) { HelpProvider.baseOwaLightUrl = exchangeAssistanceObjectFromAD.OWALightHelpURL; } if (exchangeAssistanceObjectFromAD.OWAHelpURL != null) { HelpProvider.baseOwaPremiumUrl = exchangeAssistanceObjectFromAD.OWAHelpURL; } if (exchangeAssistanceObjectFromAD.OWAFeedbackEnabled) { HelpProvider.owaPremiumFeedbackUrl = exchangeAssistanceObjectFromAD.OWAFeedbackURL; } else { HelpProvider.owaPremiumFeedbackUrl = null; } if (exchangeAssistanceObjectFromAD.OWALightFeedbackEnabled) { HelpProvider.owaLightFeedbackUrl = exchangeAssistanceObjectFromAD.OWALightFeedbackURL; } else { HelpProvider.owaLightFeedbackUrl = null; } } if (exchangeAssistanceObjectFromAD.PrivacyLinkDisplayEnabled) { HelpProvider.privacyStatementUrl = exchangeAssistanceObjectFromAD.PrivacyStatementURL; } else { HelpProvider.privacyStatementUrl = null; } if (exchangeAssistanceObjectFromAD.WindowsLiveAccountURLEnabled) { HelpProvider.windowsLiveAccountUrl = exchangeAssistanceObjectFromAD.WindowsLiveAccountPageURL; } else { HelpProvider.windowsLiveAccountUrl = null; } if (exchangeAssistanceObjectFromAD.CommunityLinkDisplayEnabled) { HelpProvider.communityUrl = exchangeAssistanceObjectFromAD.CommunityURL; return; } HelpProvider.communityUrl = null; } }