protected override IConfigurable PrepareDataObject() { TaskLogger.LogEnter(); ADUser aduser = (ADUser)base.PrepareDataObject(); aduser.BypassModerationCheck = true; if (this.SmtpAndX500Addresses != null && this.SmtpAndX500Addresses.Count > 0) { aduser.EmailAddresses = SyncTaskHelper.ReplaceSmtpAndX500Addresses(this.SmtpAndX500Addresses, aduser.EmailAddresses); } if (base.Fields.IsModified("SipAddresses")) { aduser.EmailAddresses = SyncTaskHelper.ReplaceSipAddresses(this.SipAddresses, aduser.EmailAddresses); } if (this.DataObject != null && this.DataObject.IsModified(MailEnabledRecipientSchema.EmailAddresses)) { aduser.EmailAddresses = SyncTaskHelper.FilterDuplicateEmailAddresses(base.TenantGlobalCatalogSession, this.DataObject.EmailAddresses, this.DataObject, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.TaskWarningLoggingDelegate(this.WriteWarning)); aduser.EmailAddresses = SyncTaskHelper.UpdateSipNameEumProxyAddress(aduser.EmailAddresses); } if (base.Fields.IsModified(SyncMailboxSchema.ReleaseTrack)) { aduser.ReleaseTrack = this.ReleaseTrack; } if (base.Fields.IsModified(MailboxSchema.ArchiveGuid)) { aduser.ArchiveGuid = this.ArchiveGuid; } if (this.DataObject.IsModified(SyncMailboxSchema.AccountDisabled)) { SyncTaskHelper.SetExchangeAccountDisabledWithADLogon(aduser, this.DataObject.AccountDisabled); } TaskLogger.LogExit(); return(aduser); }
protected override IConfigurable PrepareDataObject() { TaskLogger.LogEnter(); ADUser aduser = (ADUser)base.PrepareDataObject(); aduser.BypassModerationCheck = true; if (base.Fields.IsModified("IntendedMailboxPlan")) { aduser.IntendedMailboxPlan = ((this.intendedMailboxPlanObject == null) ? null : this.intendedMailboxPlanObject.Id); } if (this.SmtpAndX500Addresses != null && this.SmtpAndX500Addresses.Count > 0) { aduser.EmailAddresses = SyncTaskHelper.ReplaceSmtpAndX500Addresses(this.SmtpAndX500Addresses, aduser.EmailAddresses); } if (base.Fields.IsModified("ReleaseTrack")) { aduser.ReleaseTrack = this.ReleaseTrack; } if (base.Fields.IsModified("SipAddresses")) { aduser.EmailAddresses = SyncTaskHelper.ReplaceSipAddresses(this.SipAddresses, aduser.EmailAddresses); } if (this.DataObject.IsModified(MailEnabledRecipientSchema.EmailAddresses)) { aduser.EmailAddresses = SyncTaskHelper.FilterDuplicateEmailAddresses(base.TenantGlobalCatalogSession, this.DataObject.EmailAddresses, this.DataObject, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.TaskWarningLoggingDelegate(this.WriteWarning)); } TaskLogger.LogExit(); return(aduser); }
protected override IConfigurable PrepareDataObject() { TaskLogger.LogEnter(); ADContact adcontact = (ADContact)base.PrepareDataObject(); adcontact.BypassModerationCheck = true; if (this.SmtpAndX500Addresses != null && this.SmtpAndX500Addresses.Count > 0) { adcontact.EmailAddresses = SyncTaskHelper.ReplaceSmtpAndX500Addresses(this.SmtpAndX500Addresses, adcontact.EmailAddresses); } if (base.Fields.IsModified("SipAddresses")) { adcontact.EmailAddresses = SyncTaskHelper.ReplaceSipAddresses(this.SipAddresses, adcontact.EmailAddresses); } if (adcontact.IsModified(MailEnabledRecipientSchema.EmailAddresses)) { adcontact.EmailAddresses = SyncTaskHelper.FilterDuplicateEmailAddresses(base.TenantGlobalCatalogSession, adcontact.EmailAddresses, adcontact, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.TaskWarningLoggingDelegate(this.WriteWarning)); } TaskLogger.LogExit(); return(adcontact); }
protected override IConfigurable PrepareDataObject() { TaskLogger.LogEnter(); ADGroup adgroup = (ADGroup)base.PrepareDataObject(); adgroup.BypassModerationCheck = true; if (this.SmtpAndX500Addresses != null && this.SmtpAndX500Addresses.Count > 0) { adgroup.EmailAddresses = SyncTaskHelper.ReplaceSmtpAndX500Addresses(this.SmtpAndX500Addresses, adgroup.EmailAddresses); } if (base.Fields.IsModified("SipAddresses")) { adgroup.EmailAddresses = SyncTaskHelper.ReplaceSipAddresses(this.SipAddresses, adgroup.EmailAddresses); } if (adgroup.IsModified(MailEnabledRecipientSchema.EmailAddresses)) { adgroup.EmailAddresses = SyncTaskHelper.FilterDuplicateEmailAddresses(base.TenantGlobalCatalogSession, adgroup.EmailAddresses, adgroup, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.TaskWarningLoggingDelegate(this.WriteWarning)); } if (base.Fields.IsModified(ADGroupSchema.GroupType)) { if (this.Type != GroupType.Distribution && this.Type != GroupType.Security) { base.WriteError(new RecipientTaskException(Strings.ErrorGroupTypeInvalid), ExchangeErrorCategory.Client, null); } bool flag = (adgroup.GroupType & GroupTypeFlags.SecurityEnabled) == GroupTypeFlags.SecurityEnabled; if (this.Type == GroupType.Distribution && flag) { adgroup.GroupType &= (GroupTypeFlags)2147483647; if ((adgroup.GroupType & GroupTypeFlags.Universal) == GroupTypeFlags.Universal) { adgroup.RecipientTypeDetails = RecipientTypeDetails.MailUniversalDistributionGroup; } else { adgroup.RecipientTypeDetails = RecipientTypeDetails.MailNonUniversalGroup; } base.DesiredRecipientType = adgroup.RecipientType; if (!adgroup.IsChanged(ADRecipientSchema.RecipientDisplayType)) { adgroup.RecipientDisplayType = new RecipientDisplayType?(RecipientDisplayType.DistributionGroup); } } else if (this.Type == GroupType.Security && !flag) { if (adgroup.RecipientTypeDetails == RecipientTypeDetails.RoomList) { base.WriteError(new TaskInvalidOperationException(Strings.ErrorConvertNonUniversalDistributionGroup(adgroup.Identity.ToString())), ExchangeErrorCategory.Client, adgroup.Identity); } adgroup.GroupType |= GroupTypeFlags.SecurityEnabled; if ((adgroup.GroupType & GroupTypeFlags.Universal) == GroupTypeFlags.Universal) { adgroup.RecipientTypeDetails = RecipientTypeDetails.MailUniversalSecurityGroup; } else { adgroup.RecipientTypeDetails = RecipientTypeDetails.MailNonUniversalGroup; } base.DesiredRecipientType = adgroup.RecipientType; if (!adgroup.IsChanged(ADRecipientSchema.RecipientDisplayType)) { adgroup.RecipientDisplayType = new RecipientDisplayType?(RecipientDisplayType.SecurityDistributionGroup); } } } TaskLogger.LogExit(); return(adgroup); }