示例#1
0
        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);
        }