protected override void InternalValidate() { this.latencyContext = ProvisioningPerformanceHelper.StartLatencyDetection(this); base.InternalValidate(); base.VerifyIsWithinScopes((IRecipientSession)base.DataSession, this.DataObject, true, new DataAccessTask <ADUser> .ADObjectOutOfScopeString(Strings.ErrorCannotChangeMailboxOutOfWriteScope)); if (this.DataObject.IsModified(ADMailboxRecipientSchema.ExchangeGuid) && this.DataObject.ExchangeGuid != Guid.Empty && this.DataObject.IsModified(ADUserSchema.ArchiveGuid) && this.DataObject.ArchiveGuid != Guid.Empty && this.DataObject.ExchangeGuid == this.DataObject.ArchiveGuid) { base.WriteError(new RecipientTaskException(Strings.ErrorInvalidParameterValue("ExchangeGuid", this.DataObject.ExchangeGuid.ToString())), ExchangeErrorCategory.Client, this.DataObject.Identity); } if (this.DataObject.IsModified(ADMailboxRecipientSchema.ExchangeGuid) && this.DataObject.ExchangeGuid != Guid.Empty && !this.DataObject.IsSoftDeleted) { RecipientTaskHelper.IsExchangeGuidOrArchiveGuidUnique(this.DataObject, ADMailboxRecipientSchema.ExchangeGuid, this.DataObject.ExchangeGuid, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.ErrorLoggerDelegate(base.WriteError), ExchangeErrorCategory.Client); } if (this.DataObject.IsModified(ADUserSchema.ArchiveGuid) && this.DataObject.ArchiveGuid != Guid.Empty) { RecipientTaskHelper.IsExchangeGuidOrArchiveGuidUnique(this.DataObject, ADUserSchema.ArchiveGuid, this.DataObject.ArchiveGuid, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.ErrorLoggerDelegate(base.WriteError), ExchangeErrorCategory.Client); } if (ComplianceConfigImpl.JournalArchivingHardeningEnabled && this.DataObject.IsModified(ADRecipientSchema.EmailAddresses)) { bool flag = false; foreach (ProxyAddress proxyAddress in this.DataObject.EmailAddresses) { if (proxyAddress.Prefix == ProxyAddressPrefix.JRNL) { if (flag) { base.WriteError(new RecipientTaskException(Strings.ErrorMultipleJournalArchiveAddress), ExchangeErrorCategory.Client, this.DataObject.Identity); } flag = true; } } } }
protected override void InternalProcessRecord() { TaskLogger.LogEnter(new object[] { this.DataObject }); try { base.InternalProcessRecord(); if (base.IsSetRandomPassword) { MailboxTaskHelper.SetMailboxPassword((IRecipientSession)base.DataSession, this.DataObject, null, new Task.ErrorLoggerDelegate(base.WriteError)); } SmtpAddress value = (SmtpAddress)this.DataObject[ADRecipientSchema.WindowsLiveID]; if (value != SmtpAddress.Empty) { UserAccountControlFlags userAccountControlFlags = (UserAccountControlFlags)this.DataObject[ADUserSchema.UserAccountControl]; if ((userAccountControlFlags & UserAccountControlFlags.AccountDisabled) == UserAccountControlFlags.AccountDisabled) { this.DataObject[ADUserSchema.UserAccountControl] = (userAccountControlFlags & ~UserAccountControlFlags.AccountDisabled); using (TaskPerformanceData.SaveResult.StartRequestTimer()) { base.DataSession.Save(this.DataObject); } } } } finally { ProvisioningPerformanceHelper.StopLatencyDetection(this.latencyContext); } TaskLogger.LogExit(); }
protected override void InternalProcessRecord() { try { base.InternalProcessRecord(); } finally { ProvisioningPerformanceHelper.StopLatencyDetection(this.latencyContext); } }
protected override void InternalValidate() { this.latencyContext = ProvisioningPerformanceHelper.StartLatencyDetection(this); base.InternalValidate(); MailboxTaskHelper.BlockRemoveOrDisableIfLitigationHoldEnabled(base.DataObject, new Task.ErrorLoggerDelegate(base.WriteError), false, this.IgnoreLegalHold.ToBool()); MailboxTaskHelper.BlockRemoveOrDisableIfDiscoveryHoldEnabled(base.DataObject, new Task.ErrorLoggerDelegate(base.WriteError), false, this.IgnoreLegalHold.ToBool()); if (ComplianceConfigImpl.JournalArchivingHardeningEnabled) { MailboxTaskHelper.BlockRemoveOrDisableMailUserIfJournalArchiveEnabled(base.DataSession as IRecipientSession, this.ConfigurationSession, base.DataObject, new Task.ErrorLoggerDelegate(base.WriteError), false, this.isSyncOperation); } }
protected override void InternalProcessRecord() { try { base.InternalProcessRecord(); if (this.removeTeamMailboxFromResolverCache) { TeamMailboxADUserResolver.RemoveIdIfExists(base.DataObject.Id); } } finally { ProvisioningPerformanceHelper.StopLatencyDetection(this.latencyContext); } }
protected override void InternalValidate() { TaskLogger.LogEnter(); this.latencyContext = ProvisioningPerformanceHelper.StartLatencyDetection(this); base.InternalValidate(); if (this.DataObject.IsChanged(MailboxSchema.MasterAccountSid) && this.DataObject.IsChanged(MailboxSchema.LinkedMasterAccount)) { base.WriteError(new RecipientTaskException(Strings.ErrorSyncMailboxWithMasterAccountSid(this.DataObject.MasterAccountSid.ToString(), this.DataObject.LinkedMasterAccount)), ExchangeErrorCategory.Client, this.DataObject.Identity); } if (!base.NeedChangeMailboxSubtype && this.DataObject.IsChanged(MailboxSchema.MasterAccountSid) && this.DataObject.MasterAccountSid == null) { base.WriteError(new RecipientTaskException(Strings.ErrorSyncMailboxWithMasterAccountSidNull), ExchangeErrorCategory.Client, this.DataObject.Identity); } if (this.DataObject.IsModified(ADUserSchema.ArchiveGuid) && this.ArchiveGuid != Guid.Empty) { RecipientTaskHelper.IsExchangeGuidOrArchiveGuidUnique(this.DataObject, ADUserSchema.ArchiveGuid, this.ArchiveGuid, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.ErrorLoggerDelegate(base.WriteError), ExchangeErrorCategory.Client); } TaskLogger.LogExit(); }
protected override void InternalValidate() { this.latencyContext = ProvisioningPerformanceHelper.StartLatencyDetection(this); base.InternalValidate(); if (base.DataObject != null) { RemoveMailbox.CheckManagedGroups(base.DataObject, base.TenantGlobalCatalogSession, new Task.TaskWarningLoggingDelegate(this.WriteWarning)); if (this.orgAdminHelper.ShouldPreventLastAdminRemoval(this, base.DataObject.OrganizationId) && this.orgAdminHelper.IsLastAdmin(base.DataObject)) { base.WriteError(new CannotRemoveLastOrgAdminException(Strings.ErrorCannotRemoveLastOrgAdmin(base.DataObject.Identity.ToString())), ExchangeErrorCategory.Client, base.DataObject.Identity); } RemoveMailbox.CheckModeratedMailboxes(base.DataObject, base.TenantGlobalCatalogSession, new Task.ErrorLoggerDelegate(base.WriteError)); if (base.DataObject.CatchAllRecipientBL.Count > 0) { string domain = string.Join(", ", (from r in base.DataObject.CatchAllRecipientBL select r.Name).ToArray <string>()); base.WriteError(new CannotRemoveMailboxCatchAllRecipientException(domain), ExchangeErrorCategory.Client, base.DataObject.Identity); } } }
protected override void InternalValidate() { this.latencyContext = ProvisioningPerformanceHelper.StartLatencyDetection(this); base.InternalValidate(); }