Example #1
0
 protected override void InternalProcessRecord()
 {
     if (this.DataObject.IsInLitigationHoldOrInplaceHold)
     {
         RecoverableItemsQuotaHelper.IncreaseRecoverableItemsQuotaIfNeeded(this.DataObject);
     }
     base.InternalProcessRecord();
 }
Example #2
0
        protected override IConfigurable PrepareDataObject()
        {
            TaskLogger.LogEnter();
            ADUser aduser = (ADUser)base.PrepareDataObject();

            if (aduser.IsChanged(MailUserSchema.WindowsLiveID))
            {
                SmtpAddress value = (SmtpAddress)aduser.GetOriginalObject()[MailUserSchema.WindowsLiveID];
                if (value != SmtpAddress.Empty && !aduser.EmailAddresses.Contains(ProxyAddress.Parse("smtp", value.ToString())))
                {
                    aduser.EmailAddresses.Add(ProxyAddress.Parse("smtp", value.ToString()));
                }
            }
            if (VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).Global.MultiTenancy.Enabled)
            {
                if (aduser.IsChanged(ADRecipientSchema.ExternalEmailAddress))
                {
                    MailUserTaskHelper.ValidateExternalEmailAddress(aduser, this.ConfigurationSession, new Task.ErrorLoggerDelegate(base.WriteError), base.ProvisioningCache);
                }
                if (VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).Global.WindowsLiveID.Enabled)
                {
                    if (aduser.WindowsLiveID != SmtpAddress.Empty && !aduser.WindowsLiveID.Equals(aduser.UserPrincipalName))
                    {
                        aduser.UserPrincipalName = aduser.WindowsLiveID.ToString();
                    }
                }
                else if (!aduser.IsModified(ADUserSchema.UserPrincipalName))
                {
                    aduser.UserPrincipalName = aduser.PrimarySmtpAddress.ToString();
                }
                if (this.DataObject.IsSoftDeleted && this.DataObject.IsModified(MailUserSchema.ExchangeGuid))
                {
                    SoftDeletedTaskHelper.UpdateExchangeGuidForMailEnabledUser(this.DataObject);
                }
                if ((aduser.IsChanged(ADUserSchema.LitigationHoldEnabled) && aduser.LitigationHoldEnabled) || (aduser.IsChanged(ADRecipientSchema.InPlaceHoldsRaw) && aduser.IsInLitigationHoldOrInplaceHold) || (aduser.IsChanged(ADUserSchema.ElcMailboxFlags) && aduser.LitigationHoldEnabled))
                {
                    RecoverableItemsQuotaHelper.IncreaseRecoverableItemsQuotaIfNeeded(aduser);
                }
            }
            TaskLogger.LogExit();
            return(aduser);
        }
Example #3
0
		protected override IConfigurable PrepareDataObject()
		{
			this.DataObject = (ADUser)base.PrepareDataObject();
			if (this.DataObject.IsChanged(MailboxSchema.WindowsLiveID) && this.DataObject.WindowsLiveID != SmtpAddress.Empty)
			{
				this.DataObject.EmailAddressPolicyEnabled = false;
				SmtpAddress value = (SmtpAddress)this.DataObject.GetOriginalObject()[MailboxSchema.WindowsLiveID];
				if (value == SmtpAddress.Empty || value == this.DataObject.PrimarySmtpAddress)
				{
					this.DataObject.PrimarySmtpAddress = this.DataObject.WindowsLiveID;
				}
			}
			bool flag = false;
			ADUser dataObject = this.DataObject;
			if (this.needChangeMailboxSubtype)
			{
				if (this.originalRecipientTypeDetails == RecipientTypeDetails.UserMailbox || this.targetRecipientTypeDetails == RecipientTypeDetails.UserMailbox)
				{
					flag = true;
				}
			}
			else if (dataObject.IsChanged(ADRecipientSchema.MasterAccountSid))
			{
				flag = true;
			}
			if (!flag && (this.RemoveManagedFolderAndPolicy || base.Fields.IsModified(ADUserSchema.SharingPolicy)))
			{
				flag = true;
			}
			if (flag)
			{
				CmdletProxy.ThrowExceptionIfProxyIsNeeded(base.CurrentTaskContext, dataObject, false, this.ConfirmationMessage, new CmdletProxyInfo.ChangeCmdletProxyParametersDelegate(CmdletProxy.AppendForceToProxyCmdlet));
			}
			if ((dataObject.IsChanged(ADUserSchema.LitigationHoldEnabled) && dataObject.LitigationHoldEnabled) || (dataObject.IsChanged(ADRecipientSchema.InPlaceHoldsRaw) && dataObject.IsInLitigationHoldOrInplaceHold))
			{
				RecoverableItemsQuotaHelper.IncreaseRecoverableItemsQuotaIfNeeded(dataObject);
			}
			return this.DataObject;
		}