public ExchangeDynamicServerSnapIn() { PSConnectionInfoSingleton.GetInstance().RemotePSServerChanged += delegate(object param0, EventArgs param1) { this.UpdateRemotePSServerSettings(); }; }
public override void Initialize(IProgressProvider progressProvider) { PSConnectionInfoSingleton.GetInstance().DisplayName = this.RootNodeDisplayName; PSConnectionInfoSingleton.GetInstance().Type = OrganizationType.ToolOrEdge; PSConnectionInfoSingleton.GetInstance().Uri = PSConnectionInfoSingleton.GetRemotePowerShellUri(this.Settings.RemotePSServer); PSConnectionInfoSingleton.GetInstance().LogonWithDefaultCredential = true; PSConnectionInfoSingleton.GetInstance().Enabled = true; base.Initialize(progressProvider); }
private void UpdateRemotePSServerSettings() { bool cancelAutoRefresh = true; try { this.Settings.DoBeginInit(); this.Settings.RemotePSServer = PSConnectionInfoSingleton.GetInstance().RemotePSServer; cancelAutoRefresh = false; } finally { this.Settings.DoEndInit(cancelAutoRefresh); } }
public RunspaceServerSettingsPresentationObject CreateRunspaceServerSettingsObject() { if (EnvironmentAnalyzer.IsWorkGroup() || OrganizationType.Cloud == PSConnectionInfoSingleton.GetInstance().Type || this.ADServerSettings == null) { return(null); } if (this.ADServerSettings != null) { lock (this.syncRoot) { return(this.ADServerSettings.Clone() as RunspaceServerSettingsPresentationObject); } } return(null); }
protected override void OnDoRefreshWork(RefreshRequestEventArgs e) { this.progress = new RefreshRequestEventArgsToIProgressAdapter(e); try { this.ResetStatus(); PSConnectionInfoSingleton.GetInstance().ReportProgress = this.progress; PSConnectionInfoSingleton.GetInstance().GetMonadConnectionInfo(); this.progress.ReportProgress(50, 100, Strings.ProgressReportInitializeHelpService, Strings.ProgressReportInitializeHelpServiceErrorText); ExchangeHelpService.Initialize(); this.erc = CmdletBasedRunspaceConfiguration.Create(PSConnectionInfoSingleton.GetInstance().GetMonadConnectionInfo(), PSConnectionInfoSingleton.GetInstance().UserAccount, this.progress); this.TenantDomain = ((this.erc.LogonUserLiveID == SmtpAddress.Empty) ? null : this.erc.LogonUserLiveID.Domain); } finally { this.progress.ReportProgress(100, 100, Strings.ProgressReportEnd, string.Empty); PSConnectionInfoSingleton.GetInstance().ReportProgress = null; } base.OnDoRefreshWork(e); }
public static void Initialize() { Microsoft.Exchange.CommonHelpProvider.HelpProvider.InitializeViaCmdlet(Microsoft.Exchange.CommonHelpProvider.HelpProvider.HelpAppName.Toolbox, null, PSConnectionInfoSingleton.GetInstance().GetMonadConnectionInfo()); }
public ExchangeSnapIn() { this.helper = new ExchangeSnapInHelper(this, this); this.helper.InitializeSettingProvider(); PSConnectionInfoSingleton.GetInstance().Enabled = true; }
internal void EnforceADSettings() { ExTraceGlobals.ProgramFlowTracer.TraceFunction <ExchangeADServerSettings>(0L, "-->ExchangeSystemManagerSettings.EnforceAdSettings: {0}", this); if (this["ADServerSettings"] == null && !EnvironmentAnalyzer.IsWorkGroup() && OrganizationType.Cloud != PSConnectionInfoSingleton.GetInstance().Type) { try { try { using (MonadConnection monadConnection = new MonadConnection("timeout=30", new CommandInteractionHandler(), null, PSConnectionInfoSingleton.GetInstance().GetMonadConnectionInfo())) { monadConnection.Open(); LoggableMonadCommand loggableMonadCommand = new LoggableMonadCommand("Get-ADServerSettingsForLogonUser", monadConnection); object[] array = loggableMonadCommand.Execute(); if (array != null && array.Length > 0) { RunspaceServerSettingsPresentationObject runspaceServerSettingsPresentationObject = array[0] as RunspaceServerSettingsPresentationObject; this.ADServerSettings = runspaceServerSettingsPresentationObject; this.OrganizationalUnit = runspaceServerSettingsPresentationObject.RecipientViewRoot; this.ForestViewEnabled = runspaceServerSettingsPresentationObject.ViewEntireForest; this.GlobalCatalog = runspaceServerSettingsPresentationObject.UserPreferredGlobalCatalog; this.ConfigurationDomainController = runspaceServerSettingsPresentationObject.UserPreferredConfigurationDomainController; if (runspaceServerSettingsPresentationObject.UserPreferredDomainControllers != null && runspaceServerSettingsPresentationObject.UserPreferredDomainControllers.Count != 0) { this.DomainController = runspaceServerSettingsPresentationObject.UserPreferredDomainControllers[0]; } } else { this.SetDefaultSettings(); } } } catch (Exception) { this.SetDefaultSettings(); } goto IL_11A; } finally { this.waitHandle.Set(); } } this.waitHandle.Set(); IL_11A: ExTraceGlobals.ProgramFlowTracer.TraceFunction <ExchangeADServerSettings>(0L, "<--ExchangeSystemManagerSettings.EnforceAdSettings: {0}", this); }