Ejemplo n.º 1
0
        // Token: 0x06005DA3 RID: 23971 RVA: 0x00142FE8 File Offset: 0x001411E8
        private void PopulateTaskPopulatedProperties()
        {
            RelocationConstraintArray relocationConstraintArray = (RelocationConstraintArray)this[OrganizationSchema.PersistedRelocationConstraints];
            MultiValuedProperty <RelocationConstraint> relocationConstraints = new MultiValuedProperty <RelocationConstraint>();

            if (relocationConstraintArray != null && relocationConstraintArray.RelocationConstraints != null)
            {
                Array.ForEach <RelocationConstraint>(relocationConstraintArray.RelocationConstraints, delegate(RelocationConstraint x)
                {
                    relocationConstraints.Add(x);
                });
            }
            if (this.AdminDisplayVersion != null)
            {
                ExchangeBuild exchangeBuild = this.AdminDisplayVersion.ExchangeBuild;
                if (this.AdminDisplayVersion.ExchangeBuild.ToString().StartsWith("14"))
                {
                    relocationConstraints.Add(new RelocationConstraint(RelocationConstraintType.TenantVersionConstraint, DateTime.MaxValue));
                }
            }
            if (this.OrganizationStatus != OrganizationStatus.Active || this.IsUpgradingOrganization || this.IsPilotingOrganization || this.IsUpgradeOperationInProgress || this.IsFfoMigrationInProgress || this.IsUpdatingServicePlan)
            {
                relocationConstraints.Add(new RelocationConstraint(RelocationConstraintType.TenantInTransitionConstraint, DateTime.MaxValue));
            }
            if (!this.IsValid)
            {
                relocationConstraints.Add(new RelocationConstraint(RelocationConstraintType.ValidationErrorConstraint, DateTime.MaxValue));
            }
            if (this.EnableAsSharedConfiguration || this.ImmutableConfiguration)
            {
                relocationConstraints.Add(new RelocationConstraint(RelocationConstraintType.SCTConstraint, DateTime.MaxValue));
            }
            if (this.UpgradeE14MbxCountForCurrentStage != null && this.UpgradeE14MbxCountForCurrentStage.Value != 0)
            {
                relocationConstraints.Add(new RelocationConstraint(RelocationConstraintType.E14MailboxesPresentContraint, DateTime.MaxValue));
            }
            if (!string.IsNullOrEmpty((string)this[ExchangeConfigurationUnitSchema.TargetForest]) || !string.IsNullOrEmpty((string)this[ExchangeConfigurationUnitSchema.RelocationSourceForestRaw]))
            {
                relocationConstraints.Add(new RelocationConstraint(RelocationConstraintType.RelocationInProgressConstraint, DateTime.MaxValue));
            }
            relocationConstraints.Sort();
            this[TenantOrganizationPresentationObjectSchema.RelocationConstraints] = relocationConstraints;
            if (this.IsTemplateTenant)
            {
                this.IsSharingConfiguration = true;
            }
        }
Ejemplo n.º 2
0
        private static RelocationConstraintArray PopulateRelocationConstraintsList(RelocationConstraintArray oldRelocationConstraintsArray, PersistableRelocationConstraintType constraintTypeToSkip, RelocationConstraint constraintToAdd)
        {
            string b = constraintTypeToSkip.ToString();
            List <RelocationConstraint> list = new List <RelocationConstraint>();

            if (oldRelocationConstraintsArray != null && oldRelocationConstraintsArray.RelocationConstraints != null)
            {
                foreach (RelocationConstraint relocationConstraint in oldRelocationConstraintsArray.RelocationConstraints)
                {
                    if (relocationConstraint.Name != b)
                    {
                        list.Add(relocationConstraint);
                    }
                }
            }
            if (constraintToAdd != null)
            {
                list.Add(constraintToAdd);
            }
            list.Sort();
            return(new RelocationConstraintArray(list.ToArray()));
        }
Ejemplo n.º 3
0
        protected override IConfigurable PrepareDataObject()
        {
            TaskLogger.LogEnter();
            ExchangeConfigurationUnit exchangeConfigurationUnit = (ExchangeConfigurationUnit)base.PrepareDataObject();

            if (base.Fields.IsModified(OrganizationSchema.DefaultMovePriority))
            {
                exchangeConfigurationUnit.DefaultMovePriority = this.DefaultMovePriority;
            }
            if (base.Fields.IsModified("TenantSKUCapability"))
            {
                CapabilityHelper.SetTenantSKUCapabilities(this.PersistedCapabilities, exchangeConfigurationUnit.PersistedCapabilities);
            }
            if (base.Fields.IsModified(OrganizationSchema.UpgradeMessage))
            {
                exchangeConfigurationUnit.UpgradeMessage = this.UpgradeMessage;
            }
            if (base.Fields.IsModified(OrganizationSchema.UpgradeDetails))
            {
                exchangeConfigurationUnit.UpgradeDetails = this.UpgradeDetails;
            }
            if (base.Fields.IsModified(OrganizationSchema.UpgradeConstraints))
            {
                exchangeConfigurationUnit.UpgradeConstraints = this.UpgradeConstraints;
            }
            if (base.Fields.IsModified(OrganizationSchema.UpgradeStage))
            {
                exchangeConfigurationUnit.UpgradeStage = this.UpgradeStage;
            }
            if (base.Fields.IsModified(OrganizationSchema.UpgradeStageTimeStamp))
            {
                exchangeConfigurationUnit.UpgradeStageTimeStamp = this.UpgradeStageTimeStamp;
            }
            if (base.Fields.IsModified(OrganizationSchema.UpgradeE14RequestCountForCurrentStage))
            {
                exchangeConfigurationUnit.UpgradeE14RequestCountForCurrentStage = this.UpgradeE14RequestCountForCurrentStage;
            }
            if (base.Fields.IsModified(OrganizationSchema.UpgradeE14MbxCountForCurrentStage))
            {
                exchangeConfigurationUnit.UpgradeE14MbxCountForCurrentStage = this.UpgradeE14MbxCountForCurrentStage;
            }
            if (base.Fields.IsModified(OrganizationSchema.UpgradeLastE14CountsUpdateTime))
            {
                exchangeConfigurationUnit.UpgradeLastE14CountsUpdateTime = this.UpgradeLastE14CountsUpdateTime;
            }
            if (base.Fields.IsModified(OrganizationSchema.UpgradeConstraintsDisabled))
            {
                exchangeConfigurationUnit.UpgradeConstraintsDisabled = this.UpgradeConstraintsDisabled;
            }
            if (base.Fields.IsModified(OrganizationSchema.UpgradeUnitsOverride))
            {
                exchangeConfigurationUnit.UpgradeUnitsOverride = this.UpgradeUnitsOverride;
            }
            if (base.Fields.IsModified(OrganizationSchema.MaxAddressBookPolicies))
            {
                exchangeConfigurationUnit.MaxAddressBookPolicies = new int?(this.MaxAddressBookPolicies);
            }
            if (base.Fields.IsModified(OrganizationSchema.MaxOfflineAddressBooks))
            {
                exchangeConfigurationUnit.MaxOfflineAddressBooks = new int?(this.MaxOfflineAddressBooks);
            }
            if (this.RemoveSharedConfigurations)
            {
                exchangeConfigurationUnit.SupportedSharedConfigurations.Clear();
            }
            if (base.Fields.IsModified(OrganizationSchema.SupportedSharedConfigurations))
            {
                if (this.ClearPreviousSharedConfigurations)
                {
                    exchangeConfigurationUnit.SupportedSharedConfigurations.Clear();
                }
                foreach (ExchangeConfigurationUnit exchangeConfigurationUnit2 in this.SharedConfigurationUnits)
                {
                    if (!exchangeConfigurationUnit.SupportedSharedConfigurations.Contains(exchangeConfigurationUnit2.OrganizationId.ConfigurationUnit))
                    {
                        exchangeConfigurationUnit.SupportedSharedConfigurations.Add(exchangeConfigurationUnit2.Identity);
                    }
                }
            }
            if (base.Fields.IsModified(OrganizationSchema.EnableAsSharedConfiguration))
            {
                exchangeConfigurationUnit.EnableAsSharedConfiguration = this.EnableAsSharedConfiguration;
            }
            if (base.Fields.IsModified(OrganizationSchema.ImmutableConfiguration))
            {
                exchangeConfigurationUnit.ImmutableConfiguration = this.ImmutableConfiguration;
            }
            if (base.Fields.IsModified(OrganizationSchema.IsDehydrated))
            {
                exchangeConfigurationUnit.IsDehydrated = this.IsDehydrated;
            }
            if (base.Fields.IsModified(OrganizationSchema.IsStaticConfigurationShared))
            {
                exchangeConfigurationUnit.IsStaticConfigurationShared = this.IsStaticConfigurationShared;
            }
            if (base.Fields.IsModified(OrganizationSchema.IsUpdatingServicePlan))
            {
                exchangeConfigurationUnit.IsUpdatingServicePlan = this.IsUpdatingServicePlan;
            }
            if (base.Fields.IsModified(ExchangeConfigurationUnitSchema.ProgramId))
            {
                exchangeConfigurationUnit.ProgramId = this.ProgramId;
            }
            if (base.Fields.IsModified(ExchangeConfigurationUnitSchema.OfferId))
            {
                exchangeConfigurationUnit.OfferId = this.OfferId;
            }
            if (base.Fields.IsModified(ExchangeConfigurationUnitSchema.ServicePlan))
            {
                exchangeConfigurationUnit.ServicePlan = this.ServicePlan;
            }
            if (base.Fields.IsModified(ExchangeConfigurationUnitSchema.TargetServicePlan))
            {
                exchangeConfigurationUnit.TargetServicePlan = this.TargetServicePlan;
            }
            if (!exchangeConfigurationUnit.HostingDeploymentEnabled && Datacenter.IsPartnerHostedOnly(false))
            {
                exchangeConfigurationUnit.HostingDeploymentEnabled = true;
            }
            if (base.Fields.IsModified(OrganizationSchema.ExcludedFromBackSync))
            {
                exchangeConfigurationUnit.ExcludedFromBackSync = this.ExcludedFromBackSync;
            }
            if (base.Fields.IsModified(OrganizationSchema.ExcludedFromForwardSyncEDU2BPOS))
            {
                exchangeConfigurationUnit.ExcludedFromForwardSyncEDU2BPOS = this.ExcludedFromForwardSyncEDU2BPOS;
            }
            if (base.Fields.IsModified(ExchangeConfigurationUnitSchema.ExchangeUpgradeBucket))
            {
                if (this.ExchangeUpgradeBucket != null)
                {
                    ExchangeUpgradeBucket exchangeUpgradeBucket = (ExchangeUpgradeBucket)base.GetDataObject <ExchangeUpgradeBucket>(this.ExchangeUpgradeBucket, base.GlobalConfigSession, null, new LocalizedString?(Strings.ErrorExchangeUpgradeBucketNotFound(this.ExchangeUpgradeBucket.ToString())), new LocalizedString?(Strings.ErrorExchangeUpgradeBucketNotUnique(this.ExchangeUpgradeBucket.ToString())));
                    UpgradeBucketTaskHelper.ValidateOrganizationVersion(exchangeConfigurationUnit, exchangeUpgradeBucket, new Task.ErrorLoggerDelegate(base.WriteError));
                    UpgradeBucketTaskHelper.ValidateOrganizationAddition(base.GlobalConfigSession, exchangeConfigurationUnit.OrganizationId, exchangeUpgradeBucket, new Task.ErrorLoggerDelegate(base.WriteError));
                    exchangeConfigurationUnit.ExchangeUpgradeBucket = (ADObjectId)exchangeUpgradeBucket.Identity;
                }
                else
                {
                    exchangeConfigurationUnit.ExchangeUpgradeBucket = null;
                }
            }
            if (base.Fields.IsModified(OrganizationSchema.MailboxRelease))
            {
                exchangeConfigurationUnit.MailboxRelease = this.MailboxRelease;
            }
            if (base.Fields.IsModified(OrganizationSchema.PreviousMailboxRelease))
            {
                exchangeConfigurationUnit.PreviousMailboxRelease = this.PreviousMailboxRelease;
            }
            if (base.Fields.IsModified(OrganizationSchema.PilotMailboxRelease))
            {
                exchangeConfigurationUnit.PilotMailboxRelease = this.PilotMailboxRelease;
            }
            if (base.Fields.IsModified("AddRelocationConstraint"))
            {
                RelocationConstraint      constraintToAdd = new RelocationConstraint((RelocationConstraintType)this.RelocationConstraintType, DateTime.UtcNow.AddDays((double)this.RelocationConstraintExpirationInDays));
                RelocationConstraintArray persistedRelocationConstraints = SetOrganization.PopulateRelocationConstraintsList(exchangeConfigurationUnit.PersistedRelocationConstraints, this.RelocationConstraintType, constraintToAdd);
                exchangeConfigurationUnit.PersistedRelocationConstraints = persistedRelocationConstraints;
            }
            else if (base.Fields.IsModified("RemoveRelocationConstraint"))
            {
                RelocationConstraintArray persistedRelocationConstraints2 = SetOrganization.PopulateRelocationConstraintsList(exchangeConfigurationUnit.PersistedRelocationConstraints, this.RelocationConstraintType, null);
                exchangeConfigurationUnit.PersistedRelocationConstraints = persistedRelocationConstraints2;
            }
            OrganizationStatus organizationStatus;

            if (exchangeConfigurationUnit.IsModified(ExchangeConfigurationUnitSchema.OrganizationStatus) && exchangeConfigurationUnit.TryGetOriginalValue <OrganizationStatus>(ExchangeConfigurationUnitSchema.OrganizationStatus, out organizationStatus))
            {
                if (OrganizationStatus.Active == exchangeConfigurationUnit.OrganizationStatus && (OrganizationStatus.Suspended == organizationStatus || OrganizationStatus.LockedOut == organizationStatus))
                {
                    exchangeConfigurationUnit.IsTenantAccessBlocked = false;
                }
                else if ((OrganizationStatus.Suspended == exchangeConfigurationUnit.OrganizationStatus || OrganizationStatus.LockedOut == exchangeConfigurationUnit.OrganizationStatus) && OrganizationStatus.Active == organizationStatus)
                {
                    exchangeConfigurationUnit.IsTenantAccessBlocked = true;
                }
            }
            if (base.Fields.IsModified(OrganizationSchema.IsLicensingEnforced))
            {
                exchangeConfigurationUnit.IsLicensingEnforced = this.IsLicensingEnforced;
            }
            TaskLogger.LogExit();
            return(exchangeConfigurationUnit);
        }