Example #1
0
        private TestMigrationServerAvailabilityOutcome CreateAutodsicoverFailedOutcome(LocalizedException exception)
        {
            LocalizedString message     = exception.Data.Contains("AutoDiscoverResponseMessage") ? ((LocalizedString)exception.Data["AutoDiscoverResponseMessage"]) : exception.LocalizedString;
            string          errorDetail = exception.Data.Contains("AutoDiscoverResponseErrorDetail") ? ((string)exception.Data["AutoDiscoverResponseErrorDetail"]) : exception.ToString();

            return(TestMigrationServerAvailabilityOutcome.Create(TestMigrationServerAvailabilityResult.Failed, this.SupportsCutover, message, errorDetail));
        }
Example #2
0
        private void InternalProcessPublicFolder()
        {
            TestMigrationServerAvailabilityOutcome sendToPipeline;

            try
            {
                TestMigrationServerAvailability.VerifyPublicFolderConnection(base.DataProvider, (PublicFolderEndpoint)this.endpoint, this.SourceMailboxLegacyDN, this.PublicFolderDatabaseServerLegacyDN, this.targetMailbox);
                ExchangeConnectionSettings connectionSettings = this.endpoint.ConnectionSettings as ExchangeConnectionSettings;
                sendToPipeline = TestMigrationServerAvailabilityOutcome.Create(TestMigrationServerAvailabilityResult.Success, this.SupportsCutover, connectionSettings);
            }
            catch (LocalizedException ex)
            {
                sendToPipeline = TestMigrationServerAvailabilityOutcome.Create(TestMigrationServerAvailabilityResult.Failed, this.SupportsCutover, ex.LocalizedString, ex.ToString());
            }
            base.WriteObject(sendToPipeline);
        }
Example #3
0
 private void InternalProcessExchangeRemoteMoveAutoDiscover()
 {
     try
     {
         ExchangeRemoteMoveEndpoint exchangeRemoteMoveEndpoint = new ExchangeRemoteMoveEndpoint();
         exchangeRemoteMoveEndpoint.InitializeFromAutoDiscover(this.EmailAddress, this.Credentials);
         this.endpoint = exchangeRemoteMoveEndpoint;
     }
     catch (LocalizedException ex)
     {
         MigrationLogger.Log(MigrationEventType.Error, ex, "Failed to determine remote endpoint via auto-discover.", new object[0]);
         base.WriteObject(TestMigrationServerAvailabilityOutcome.Create(TestMigrationServerAvailabilityResult.Failed, this.SupportsCutover, ex.LocalizedString, ex.ToString()));
         return;
     }
     this.InternalProcessEndpoint(true);
 }
Example #4
0
        private void InternalProcessEndpoint(bool fromAutoDiscover)
        {
            TestMigrationServerAvailabilityOutcome sendToPipeline;

            try
            {
                this.endpoint.VerifyConnectivity();
                ExchangeConnectionSettings connectionSettings = this.endpoint.ConnectionSettings as ExchangeConnectionSettings;
                sendToPipeline = TestMigrationServerAvailabilityOutcome.Create(TestMigrationServerAvailabilityResult.Success, this.SupportsCutover, connectionSettings);
            }
            catch (LocalizedException ex)
            {
                if (fromAutoDiscover)
                {
                    ex = new MigrationRemoteEndpointSettingsCouldNotBeAutodiscoveredException(this.endpoint.RemoteServer.ToString(), ex);
                }
                sendToPipeline = TestMigrationServerAvailabilityOutcome.Create(TestMigrationServerAvailabilityResult.Failed, this.SupportsCutover, ex.LocalizedString, ex.ToString());
            }
            base.WriteObject(sendToPipeline);
        }
Example #5
0
        private void InternalProcessExchangeOutlookAnywhere(IMigrationDataProvider dataProvider)
        {
            ExchangeOutlookAnywhereEndpoint exchangeOutlookAnywhereEndpoint = new ExchangeOutlookAnywhereEndpoint();

            try
            {
                if (this.Autodiscover)
                {
                    TestMigrationServerAvailabilityOutcome testMigrationServerAvailabilityOutcome = null;
                    try
                    {
                        exchangeOutlookAnywhereEndpoint.InitializeFromAutoDiscover(this.EmailAddress, this.Credentials);
                    }
                    catch (AutoDiscoverFailedConfigurationErrorException exception)
                    {
                        testMigrationServerAvailabilityOutcome = this.CreateAutodsicoverFailedOutcome(exception);
                    }
                    catch (AutoDiscoverFailedInternalErrorException exception2)
                    {
                        testMigrationServerAvailabilityOutcome = this.CreateAutodsicoverFailedOutcome(exception2);
                    }
                    if (testMigrationServerAvailabilityOutcome != null)
                    {
                        MigrationLogger.Log(MigrationEventType.Information, testMigrationServerAvailabilityOutcome.ToString(), new object[0]);
                        base.WriteObject(testMigrationServerAvailabilityOutcome);
                        return;
                    }
                }
                else
                {
                    exchangeOutlookAnywhereEndpoint.RpcProxyServer       = this.RPCProxyServer;
                    exchangeOutlookAnywhereEndpoint.Credentials          = this.Credentials;
                    exchangeOutlookAnywhereEndpoint.ExchangeServer       = this.ExchangeServer;
                    exchangeOutlookAnywhereEndpoint.AuthenticationMethod = this.Authentication;
                }
                IMigrationNspiClient nspiClient = MigrationServiceFactory.Instance.GetNspiClient(null);
                exchangeOutlookAnywhereEndpoint.NspiServer        = nspiClient.GetNewDSA(exchangeOutlookAnywhereEndpoint);
                exchangeOutlookAnywhereEndpoint.MailboxPermission = this.MailboxPermission;
                NspiMigrationDataReader nspiDataReader = exchangeOutlookAnywhereEndpoint.GetNspiDataReader(null);
                nspiDataReader.Ping();
                ExchangeOutlookAnywhereEndpoint.ValidateEndpoint(exchangeOutlookAnywhereEndpoint);
            }
            catch (MigrationTransientException ex)
            {
                MigrationLogger.Log(MigrationEventType.Warning, MigrationLogger.GetDiagnosticInfo(ex, null), new object[0]);
                base.WriteObject(TestMigrationServerAvailabilityOutcome.Create(TestMigrationServerAvailabilityResult.Failed, this.SupportsCutover, ex.LocalizedString, ex.InternalError));
                return;
            }
            catch (MigrationPermanentException ex2)
            {
                MigrationLogger.Log(MigrationEventType.Error, MigrationLogger.GetDiagnosticInfo(ex2, null), new object[0]);
                base.WriteObject(TestMigrationServerAvailabilityOutcome.Create(TestMigrationServerAvailabilityResult.Failed, this.SupportsCutover, ex2.LocalizedString, ex2.InternalError));
                return;
            }
            TestMigrationServerAvailabilityOutcome testMigrationServerAvailabilityOutcome2;

            try
            {
                TestMigrationServerAvailability.VerifyExchangeOutlookAnywhereConnection(dataProvider, exchangeOutlookAnywhereEndpoint, (string)this.EmailAddress, this.SourceMailboxLegacyDN, this.targetMailbox, !this.IsFieldSet("MailboxPermission"));
                testMigrationServerAvailabilityOutcome2 = TestMigrationServerAvailabilityOutcome.Create(TestMigrationServerAvailabilityResult.Success, this.SupportsCutover, (ExchangeConnectionSettings)exchangeOutlookAnywhereEndpoint.ConnectionSettings);
            }
            catch (LocalizedException ex3)
            {
                string diagnosticInfo = MigrationLogger.GetDiagnosticInfo(ex3, null);
                MigrationLogger.Log(MigrationEventType.Error, diagnosticInfo, new object[0]);
                testMigrationServerAvailabilityOutcome2 = TestMigrationServerAvailabilityOutcome.Create(TestMigrationServerAvailabilityResult.Failed, this.SupportsCutover, ex3.LocalizedString, diagnosticInfo);
                testMigrationServerAvailabilityOutcome2.ConnectionSettings = (ExchangeConnectionSettings)exchangeOutlookAnywhereEndpoint.ConnectionSettings;
            }
            base.WriteObject(testMigrationServerAvailabilityOutcome2);
        }