protected override void InternalValidate()
 {
     TaskLogger.LogEnter();
     base.InternalValidate();
     if (!VariantConfiguration.InvariantNoFlightingSnapshot.CmdletInfra.EmailAddressPolicy.Enabled)
     {
         this.DataObject.EmailAddressPolicyEnabled = false;
     }
     DistributionGroupTaskHelper.CheckModerationInMixedEnvironment(this.DataObject, new Task.TaskWarningLoggingDelegate(this.WriteWarning), Strings.WarningLegacyExchangeServer);
     TaskLogger.LogExit();
 }
Exemplo n.º 2
0
 protected override void InternalValidate()
 {
     TaskLogger.LogEnter();
     base.InternalValidate();
     if (base.HasErrors)
     {
         return;
     }
     DistributionGroupTaskHelper.CheckModerationInMixedEnvironment(this.DataObject, new Task.TaskWarningLoggingDelegate(this.WriteWarning), Strings.WarningLegacyExchangeServer);
     if (base.Fields.IsModified(DynamicDistributionGroupSchema.RecipientFilter) && VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).CmdletInfra.SupportOptimizedFilterOnlyInDDG.Enabled)
     {
         QueryFilter     oldFilter = this.ConvertToQueryFilter(this.originalFilter);
         LocalizedString?localizedString;
         if (!DynamicDistributionGroupFilterValidation.IsFullOptimizedOrImproved(oldFilter, this.innerFilter, out localizedString))
         {
             base.WriteError(new RecipientTaskException(localizedString.Value, null), ExchangeErrorCategory.Client, this.DataObject.Identity);
         }
     }
     TaskLogger.LogExit();
 }
Exemplo n.º 3
0
 protected override void InternalValidate()
 {
     TaskLogger.LogEnter();
     base.InternalValidate();
     if (string.IsNullOrEmpty(this.DataObject.LegacyExchangeDN))
     {
         AdministrativeGroup administrativeGroup = base.GlobalConfigSession.GetAdministrativeGroup();
         string parentLegacyDN = string.Format(CultureInfo.InvariantCulture, "{0}/cn=Recipients", new object[]
         {
             administrativeGroup.LegacyExchangeDN
         });
         this.DataObject.LegacyExchangeDN = LegacyDN.GenerateLegacyDN(parentLegacyDN, this.DataObject, true, new LegacyDN.LegacyDNIsUnique(this.LegacyDNIsUnique));
     }
     if (!VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).CmdletInfra.EmailAddressPolicy.Enabled)
     {
         this.DataObject.EmailAddressPolicyEnabled = false;
     }
     DistributionGroupTaskHelper.CheckModerationInMixedEnvironment(this.DataObject, new Task.TaskWarningLoggingDelegate(this.WriteWarning), Strings.WarningLegacyExchangeServer);
     TaskLogger.LogExit();
 }
Exemplo n.º 4
0
        protected override void InternalValidate()
        {
            TaskLogger.LogEnter();
            base.InternalValidate();
            if (base.HasErrors)
            {
                return;
            }
            DistributionGroupTaskHelper.CheckMembershipRestriction(this.DataObject, new Task.ErrorLoggerDelegate(base.WriteError));
            if (this.RoomList.IsPresent && this.DataObject.RecipientTypeDetails != RecipientTypeDetails.RoomList)
            {
                this.ValidateConvertToRoomList();
            }
            base.ValidateMultiReferenceParameter(DistributionGroupSchema.ManagedBy, new ValidateRecipientWithBaseObjectDelegate <ADGroup>(MailboxTaskHelper.ValidateGroupManagedBy));
            MultiValuedProperty <ADRecipient> recipients;

            this.recipientsDictionary.TryGetValue(DistributionGroupSchema.ManagedBy, out recipients);
            if (base.Fields.IsModified(DistributionGroupSchema.ManagedBy) || base.Fields.IsModified(DistributionGroupSchema.MemberJoinRestriction) || base.Fields.IsModified(DistributionGroupSchema.MemberDepartRestriction) || this.DataObject.ModerationEnabled || base.Fields.IsModified(MailEnabledRecipientSchema.ModeratedBy))
            {
                MailboxTaskHelper.ValidateGroupManagedByRecipientRestriction(base.TenantGlobalCatalogSession, this.DataObject, recipients, new DataAccessHelper.CategorizedGetDataObjectDelegate(base.GetDataObject <ADRecipient>), new Task.ErrorLoggerDelegate(base.WriteError), new Task.TaskWarningLoggingDelegate(this.WriteWarning));
            }
            if (this.DataObject.IsModified(ADMailboxRecipientSchema.SamAccountName))
            {
                RecipientTaskHelper.IsSamAccountNameUnique(this.DataObject, this.DataObject.SamAccountName, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.ErrorLoggerDelegate(base.WriteError), ExchangeErrorCategory.Client);
            }
            if (base.Fields.IsModified("ExpansionServer"))
            {
                this.DataObject.ExpansionServer = this.ExpansionServer;
                this.DataObject.HomeMTA         = this.homeMTA;
            }
            else if (this.DataObject.IsChanged(DistributionGroupBaseSchema.ExpansionServer))
            {
                if (!string.IsNullOrEmpty(this.DataObject.ExpansionServer))
                {
                    QueryFilter filter = new ComparisonFilter(ComparisonOperator.Equal, ServerSchema.ExchangeLegacyDN, this.DataObject.ExpansionServer);
                    base.WriteVerbose(TaskVerboseStringHelper.GetFindDataObjectsVerboseString(base.GlobalConfigSession, typeof(Server), filter, null, true));
                    Server[] array = null;
                    try
                    {
                        array = base.GlobalConfigSession.Find <Server>(null, QueryScope.SubTree, filter, null, 2);
                    }
                    finally
                    {
                        base.WriteVerbose(TaskVerboseStringHelper.GetSourceVerboseString(base.GlobalConfigSession));
                    }
                    switch (array.Length)
                    {
                    case 0:
                        base.WriteError(new ManagementObjectNotFoundException(Strings.ErrorServerNotFound(this.DataObject.ExpansionServer)), ExchangeErrorCategory.Client, this.Identity);
                        return;

                    case 1:
                        base.ValidateExpansionServer(array[0], false);
                        this.DataObject.ExpansionServer = array[0].ExchangeLegacyDN;
                        break;

                    case 2:
                        base.WriteError(new ManagementObjectAmbiguousException(Strings.ErrorServerNotUnique(this.DataObject.ExpansionServer)), ExchangeErrorCategory.Client, this.Identity);
                        return;
                    }
                    this.DataObject.HomeMTA = array[0].ResponsibleMTA;
                }
                else
                {
                    this.DataObject.HomeMTA = null;
                }
            }
            DistributionGroupTaskHelper.CheckModerationInMixedEnvironment(this.DataObject, new Task.TaskWarningLoggingDelegate(this.WriteWarning), Strings.WarningLegacyExchangeServer);
            TaskLogger.LogExit();
        }
Exemplo n.º 5
0
 protected override void InternalValidate()
 {
     base.InternalValidate();
     DistributionGroupTaskHelper.CheckModerationInMixedEnvironment(this.DataObject, new Task.TaskWarningLoggingDelegate(this.WriteWarning), Strings.WarningLegacyExchangeServerForMailContact);
 }