Ejemplo n.º 1
0
 internal string DiagnoseMapiOperationException(LocalizedException exception, out bool targetDatabaseMoved, out bool storeNotRunning)
 {
     targetDatabaseMoved = false;
     storeNotRunning     = false;
     try
     {
         if (this.isDatabaseCopyActive)
         {
             DatabaseLocationInfo serverForDatabase = RecipientTaskHelper.GetActiveManagerInstance().GetServerForDatabase(this.database.Guid);
             if (string.Compare(serverForDatabase.ServerFqdn, this.targetServer.Fqdn, StringComparison.OrdinalIgnoreCase) != 0)
             {
                 targetDatabaseMoved = true;
                 return(Strings.MapiTransactionDiagnosticTargetDatabaseNotOnTargetServer(serverForDatabase.ServerFqdn, this.targetServer.Fqdn));
             }
         }
     }
     catch (ObjectNotFoundException exception2)
     {
         return(Strings.MapiTransactionDiagnosticFailedToGetMdbLocation(this.ShortErrorMsgFromException(exception2)));
     }
     using (ServiceController serviceController = new ServiceController("MSExchangeIS", this.targetServer.Fqdn))
     {
         try
         {
             if (serviceController.Status != ServiceControllerStatus.Running)
             {
                 storeNotRunning = true;
                 return(Strings.MapiTransactionDiagnosticStoreServiceIsNotRunning);
             }
         }
         catch (InvalidOperationException exception3)
         {
             return(Strings.MapiTransactionDiagnosticStoreServiceCheckFailure(this.ShortErrorMsgFromException(exception3)));
         }
     }
     try
     {
         string errorStringBasedOnDatabaseCopyState = this.GetErrorStringBasedOnDatabaseCopyState();
         if (!string.IsNullOrWhiteSpace(errorStringBasedOnDatabaseCopyState))
         {
             return(errorStringBasedOnDatabaseCopyState);
         }
     }
     catch (MapiPermanentException exception4)
     {
         return(Strings.MapiTransactionDiagnosticStoreStateCheckFailure(this.ShortErrorMsgFromException(exception4)));
     }
     catch (MapiRetryableException exception5)
     {
         return(Strings.MapiTransactionDiagnosticStoreStateCheckFailure(this.ShortErrorMsgFromException(exception5)));
     }
     return(this.ShortErrorMsgFromException(exception));
 }
Ejemplo n.º 2
0
 private DatabaseLocationInfo GetDatabaseLocationInfo(MailboxDatabase database)
 {
     this.WriteDebugInfo("Checking {0} database with ActiveManager.", new object[]
     {
         database.Name
     });
     try
     {
         return(RecipientTaskHelper.GetActiveManagerInstance().GetServerForDatabase(database.Guid));
     }
     catch (ObjectNotFoundException ex)
     {
         this.WriteDebugInfo(ex.Message, new object[0]);
     }
     catch (ServerForDatabaseNotFoundException ex2)
     {
         this.WriteDebugInfo(ex2.Message, new object[0]);
     }
     return(null);
 }
Ejemplo n.º 3
0
 protected override void InternalProcessRecord()
 {
     TaskLogger.LogEnter(new object[]
     {
         this.DataObject
     });
     base.InternalProcessRecord();
     if (this.recoverArchive && this.DataObject.ArchiveDatabase != null)
     {
         MailboxDatabase database = (MailboxDatabase)base.GetDataObject <MailboxDatabase>(new DatabaseIdParameter(this.DataObject.ArchiveDatabase), base.GlobalConfigSession, null, new LocalizedString?(Strings.ErrorDatabaseNotFound(this.DataObject.ArchiveDatabase.ToString())), new LocalizedString?(Strings.ErrorDatabaseNotUnique(this.DataObject.ArchiveDatabase.ToString())));
         using (MapiAdministrationSession adminSession = MapiTaskHelper.GetAdminSession(RecipientTaskHelper.GetActiveManagerInstance(), this.DataObject.ArchiveDatabase.ObjectGuid))
         {
             ConnectMailbox.UpdateSDAndRefreshMailbox(adminSession, this.DataObject, database, this.DataObject.ArchiveGuid, null, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.TaskWarningLoggingDelegate(this.WriteWarning));
         }
     }
     TaskLogger.LogExit();
 }