private void RemoveMailUser() { if (this.mailUser == null) { this.WriteWarning(Strings.WarningJournalArchiveMailboxHasNoMailUser); return; } if (DisableJournalArchiving.ShouldSoftDeleteUser(this.mailUser)) { SoftDeletedTaskHelper.UpdateRecipientForSoftDelete(base.DataSession as IRecipientSession, this.mailUser, false); SoftDeletedTaskHelper.UpdateExchangeGuidForMailEnabledUser(this.mailUser); this.mailUser.JournalArchiveAddress = SmtpAddress.NullReversePath; base.WriteVerbose(TaskVerboseStringHelper.GetDeleteObjectVerboseString(this.mailUser.Identity, base.DataSession, typeof(ADUser))); try { try { RecipientTaskHelper.CreateSoftDeletedObjectsContainerIfNecessary(this.mailUser.Id.Parent, base.DomainController); base.DataSession.Save(this.mailUser); } catch (DataSourceTransientException exception) { base.WriteError(exception, ExchangeErrorCategory.ServerTransient, null); } return; } finally { base.WriteVerbose(TaskVerboseStringHelper.GetSourceVerboseString(base.DataSession)); } } base.WriteError(new RecipientTaskException(Strings.ErrorDisableJournalArchiveMailuserNotSoftDeleted), ExchangeErrorCategory.Client, this.mailUser.Identity); }
protected override bool ShouldSoftDeleteObject() { return(DisableJournalArchiving.ShouldSoftDeleteUser(base.DataObject)); }