protected override void InternalValidate() { TaskLogger.LogEnter(); base.InternalValidate(); if (this.tenantCU.IsUpgradingOrganization) { base.WriteError(new InvalidOperationException(Strings.ErrorCannotStartPilotFOrOrgBeingUpgraded(this.tenantCU.OrganizationId.OrganizationalUnit.Name)), (ErrorCategory)1002, null); } string b; if (!this.tenantCU.IsPilotingOrganization && (!ServicePlanConfiguration.GetInstance().TryGetAllowedSorceServicePlanForPilot(this.tenantCU.ProgramId, this.TargetOfferId, out b) || this.tenantCU.ServicePlan != b)) { base.WriteError(new InvalidOperationException(Strings.ErrorServicePlanDoesNotSupportPilot(this.tenantCU.OrganizationId.OrganizationalUnit.Name, this.tenantCU.ServicePlan, this.tenantCU.ProgramId)), (ErrorCategory)1000, null); } base.InternalPilotEnabled = true; TaskLogger.LogExit(); }
protected override void InternalValidate() { base.InternalValidate(); if (this.DataObject.IsModified(ExchangeConfigurationUnitSchema.DirSyncServiceInstance) && !string.IsNullOrEmpty(this.DataObject.DirSyncServiceInstance) && !ServiceInstanceId.IsValidServiceInstanceId(this.DataObject.DirSyncServiceInstance)) { base.WriteError(new InvalidServiceInstanceIdException(this.DataObject.DirSyncServiceInstance), ExchangeErrorCategory.Client, null); } if (this.DataObject.IsChanged(OrganizationSchema.SupportedSharedConfigurations) && !this.RemoveSharedConfigurations) { foreach (ExchangeConfigurationUnit exchangeConfigurationUnit in this.SharedConfigurationUnits) { if (exchangeConfigurationUnit.SharedConfigurationInfo == null) { base.WriteError(new SharedConfigurationValidationException(Strings.SharedConfigurationInfoNotPresent(exchangeConfigurationUnit.Identity.ToString())), ExchangeErrorCategory.Client, null); } ServicePlanConfiguration instance = ServicePlanConfiguration.GetInstance(); if (!exchangeConfigurationUnit.ProgramId.Equals(this.DataObject.ProgramId, StringComparison.OrdinalIgnoreCase) || (!this.IsHydratedOfferIdMatched(this.DataObject.ProgramId, this.DataObject.OfferId, exchangeConfigurationUnit, instance) && !this.IsPilotOfferIdMatched(this.DataObject.ProgramId, this.DataObject.OfferId, exchangeConfigurationUnit, instance) && !this.IsHydratedPilotOfferIdMatched(this.DataObject.ProgramId, this.DataObject.OfferId, exchangeConfigurationUnit, instance))) { base.WriteError(new SharedConfigurationValidationException(Strings.OfferIdMatchError(this.Identity.ToString(), this.DataObject.ProgramId, this.DataObject.OfferId, exchangeConfigurationUnit.Identity.ToString(), exchangeConfigurationUnit.ProgramId, exchangeConfigurationUnit.OfferId)), ExchangeErrorCategory.Client, null); } if (!exchangeConfigurationUnit.EnableAsSharedConfiguration) { base.WriteError(new SharedConfigurationValidationException(Strings.SharedConfigurationNotEnabled(this.Identity.ToString(), exchangeConfigurationUnit.Identity.ToString())), ExchangeErrorCategory.Client, null); } } if (this.DataObject.SharedConfigurationInfo != null) { base.WriteError(new SharedConfigurationValidationException(Strings.SharedConfigurationInfoExists(this.Identity.ToString(), this.DataObject.SharedConfigurationInfo.ToString())), ExchangeErrorCategory.Client, null); } } if (this.DataObject.IsChanged(OrganizationSchema.EnableAsSharedConfiguration) && !this.DataObject.EnableAsSharedConfiguration) { if (this.DataObject.SharedConfigurationInfo == null) { base.WriteError(new SharedConfigurationValidationException(Strings.SharedConfigurationInfoNotPresent(this.DataObject.Identity.ToString())), ExchangeErrorCategory.Client, null); } ExchangeConfigurationUnit[] array = OrganizationTaskHelper.FindSharedConfigurations(this.DataObject.SharedConfigurationInfo, this.DataObject.OrganizationId.PartitionId); if (array == null || array.Length < 2) { this.confirmLastSharedConfiguration = true; } } }
protected override void InternalValidate() { base.InternalValidate(); if (!this.tenantCU.IsUpgradingOrganization) { base.WriteError(new OrganizationUpgradeException(Strings.ErrorOrganizationIsNotInUpgradeState), ExchangeErrorCategory.Client, base.Identity); } ServicePlan servicePlanSettings = ServicePlanConfiguration.GetInstance().GetServicePlanSettings(this.tenantCU.ProgramId, this.tenantCU.OfferId); base.InternalIsSharedConfigServicePlan = ServicePlanConfiguration.GetInstance().IsSharedConfigurationAllowedForServicePlan(servicePlanSettings); base.InternalLocalStaticConfigEnabled = !servicePlanSettings.Organization.AdvancedHydrateableObjectsSharedEnabled; base.InternalLocalHydrateableConfigEnabled = !servicePlanSettings.Organization.CommonHydrateableObjectsSharedEnabled; if (base.InternalIsSharedConfigServicePlan) { if (this.tenantCU.SharedConfigurationInfo != null) { base.WriteError(new SharedConfigurationValidationException(Strings.ErrorSharedConfigurationUpgradeNotSupported), ExchangeErrorCategory.Client, base.Identity); return; } base.InternalCreateSharedConfiguration = false; } }
protected override void InternalValidate() { TaskLogger.LogEnter(); base.InternalValidate(); Exception ex = null; try { if (string.IsNullOrEmpty(this.tenantCU.ServicePlan)) { base.WriteError(new InvalidOperationException(Strings.ErrorServicePlanIsNotSet), (ErrorCategory)1002, null); } if (ServicePlanConfiguration.IsDeprecatedServicePlan(this.tenantCU.ServicePlan)) { base.WriteError(new InvalidOperationException(Strings.ErrorServicePlanIsDeprecated(this.tenantCU.Name, this.tenantCU.ServicePlan, this.tenantCU.ProgramId)), (ErrorCategory)1002, null); } this.servicePlanSettings = ServicePlanConfiguration.GetInstance().GetServicePlanSettings(this.tenantCU.ServicePlan); base.InternalLocalStaticConfigEnabled = !this.servicePlanSettings.Organization.AdvancedHydrateableObjectsSharedEnabled; base.InternalLocalHydrateableConfigEnabled = !this.servicePlanSettings.Organization.CommonHydrateableObjectsSharedEnabled; } catch (ArgumentException ex2) { ex = ex2; } catch (IOException ex3) { ex = ex3; } if (ex != null) { base.WriteError(ex, (ErrorCategory)1000, null); } if (!string.IsNullOrEmpty(this.tenantCU.TargetServicePlan)) { string value = ServicePlanConfiguration.GetInstance().ResolveServicePlanName(this.tenantCU.ProgramId, this.TargetOfferId); if (!this.tenantCU.TargetServicePlan.Equals(value, StringComparison.OrdinalIgnoreCase)) { base.WriteError(new InvalidOperationException(Strings.ErrorOOBUpgradeInProgress(this.tenantCU.ServicePlan, this.tenantCU.TargetServicePlan)), (ErrorCategory)1002, null); } } base.InternalIsSharedConfigServicePlan = ServicePlanConfiguration.GetInstance().IsSharedConfigurationAllowedForServicePlan(this.tenantCU.ProgramId, this.tenantCU.OfferId); if (base.InternalIsSharedConfigServicePlan) { if (this.tenantCU.SharedConfigurationInfo == null) { ITenantConfigurationSession tenantConfigurationSession = DirectorySessionFactory.Default.CreateTenantConfigurationSession(false, ConsistencyMode.PartiallyConsistent, ADSessionSettings.FromAllTenantsObjectId(this.tenantCU.Id), 210, "InternalValidate", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\Deployment\\StartOrganizationUpgradeTask.cs"); Result <ExchangeConfigurationUnit>[] array = tenantConfigurationSession.ReadMultiple <ExchangeConfigurationUnit>(this.tenantCU.SupportedSharedConfigurations.ToArray()); string offerId; if (!ServicePlanConfiguration.GetInstance().TryGetHydratedOfferId(this.tenantCU.ProgramId, this.tenantCU.OfferId, out offerId)) { offerId = this.tenantCU.OfferId; } SharedConfigurationInfo sharedConfigurationInfo = SharedConfigurationInfo.FromInstalledVersion(this.tenantCU.ProgramId, offerId); foreach (Result <ExchangeConfigurationUnit> result in array) { if (result.Data != null) { ExchangeConfigurationUnit data = result.Data; if (data.SharedConfigurationInfo.Equals(sharedConfigurationInfo)) { base.InternalSharedConfigurationId = data.OrganizationId; break; } } } if (base.InternalSharedConfigurationId == null) { base.InternalSharedConfigurationId = SharedConfiguration.FindOneSharedConfigurationId(sharedConfigurationInfo, base.CurrentOrganizationId.PartitionId); } if (base.InternalSharedConfigurationId == null) { base.WriteError(new SharedConfigurationValidationException(Strings.ErrorSharedConfigurationNotFound(this.tenantCU.ProgramId, offerId, sharedConfigurationInfo.CurrentVersion.ToString())), ExchangeErrorCategory.Client, null); } } else { base.WriteError(new SharedConfigurationValidationException(Strings.ErrorSharedConfigurationUpgradeNotSupported), ExchangeErrorCategory.Client, null); } } Exception ex4 = Utils.ValidateTransportRuleRegexesForMigratingTenants(this.tenantCU.OrganizationId); if (ex4 != null) { base.WriteError(new SharedConfigurationValidationException(Strings.ErrorE14TenantRulesNeedUpdateBeforeMigratingToE15(ex4.Message)), ExchangeErrorCategory.Client, null); } TaskLogger.LogExit(); }
protected override void InternalValidate() { TaskLogger.LogEnter(); base.InternalValidate(); OrganizationId organizationId = OrganizationTaskHelper.ResolveOrganization(this, this.Identity, base.RootOrgContainerId, Strings.ErrorOrganizationIdentityRequired); if (this.Identity == null) { this.Identity = new OrganizationIdParameter(organizationId.OrganizationalUnit.Name); } ADSessionSettings sessionSettings = ADSessionSettings.FromAllTenantsPartitionId(organizationId.PartitionId); this.adSession = DirectorySessionFactory.Default.CreateTenantConfigurationSession((base.ServerSettings == null) ? null : base.ServerSettings.PreferredGlobalCatalog(organizationId.PartitionId.ForestFQDN), false, ConsistencyMode.PartiallyConsistent, sessionSettings, 262, "InternalValidate", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\Deployment\\RemoveOrganization.cs"); this.tenantOU = OrganizationTaskHelper.GetOUFromOrganizationId(this.Identity, this.adSession, new Task.TaskErrorLoggingDelegate(base.WriteError), false); if (this.tenantOU == null) { base.WriteError(new OrganizationDoesNotExistException(Strings.ErrorOrganizationNotFound(this.Identity.ToString())), ErrorCategory.InvalidArgument, null); } this.adSession.UseConfigNC = true; this.exchangeConfigUnit = this.adSession.Read <ExchangeConfigurationUnit>(this.tenantOU.ConfigurationUnit); if (!OrganizationTaskHelper.CanProceedWithOrganizationTask(this.Identity, this.adSession, RemoveOrganization.ignorableFlagsOnStatusTimeout, new Task.TaskErrorLoggingDelegate(base.WriteError))) { base.WriteError(new OrganizationPendingOperationException(Strings.ErrorCannotRemoveNonActiveOrganization(this.Identity.ToString())), ErrorCategory.InvalidArgument, null); } ServicePlan servicePlanSettings = ServicePlanConfiguration.GetInstance().GetServicePlanSettings(this.exchangeConfigUnit.ProgramId, this.exchangeConfigUnit.OfferId); base.InternalLocalStaticConfigEnabled = !servicePlanSettings.Organization.AdvancedHydrateableObjectsSharedEnabled; base.InternalLocalHydrateableConfigEnabled = !servicePlanSettings.Organization.CommonHydrateableObjectsSharedEnabled; base.InternalCreateSharedConfiguration = (this.exchangeConfigUnit.SharedConfigurationInfo != null); ADSessionSettings sessionSettings2 = ADSessionSettings.FromOrganizationIdWithoutRbacScopes(base.RootOrgContainerId, this.tenantOU.OrganizationId, base.ExecutingUserOrganizationId, false); this.recipientSession = DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession((base.ServerSettings == null) ? null : base.ServerSettings.PreferredGlobalCatalog(organizationId.PartitionId.ForestFQDN), true, ConsistencyMode.PartiallyConsistent, sessionSettings2, 314, "InternalValidate", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\Deployment\\RemoveOrganization.cs"); IConfigurationSession tenantOrTopologyConfigurationSession = DirectorySessionFactory.Default.GetTenantOrTopologyConfigurationSession((base.ServerSettings == null) ? null : base.ServerSettings.PreferredGlobalCatalog(organizationId.PartitionId.ForestFQDN), true, ConsistencyMode.PartiallyConsistent, sessionSettings2, 320, "InternalValidate", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\Deployment\\RemoveOrganization.cs"); TransportConfigContainer transportConfigContainer = tenantOrTopologyConfigurationSession.FindSingletonConfigurationObject <TransportConfigContainer>(); if (transportConfigContainer != null) { this.organizationFederatedMailboxAlias = transportConfigContainer.OrganizationFederatedMailbox.Local; } if (!this.Force && this.GetUserMailboxCount(2) > 0) { base.WriteError(new OrganizationValidationException(Strings.RemoveOrganizationFailWithExistingMailboxes), ErrorCategory.InvalidOperation, this.Identity); } if (ExchangeConfigurationUnit.RelocationInProgress(this.exchangeConfigUnit)) { base.WriteError(new OrganizationValidationException(Strings.RemoveOrganizationFailRelocationInProgress), (ErrorCategory)1000, this.Identity); } if (this.exchangeConfigUnit.EnableAsSharedConfiguration) { base.WriteError(new OrganizationValidationException(Strings.RemoveOrganizationFailWithoutSharedConfigurationParameter), (ErrorCategory)1000, this.Identity); } if (OrganizationTaskHelper.IsSharedConfigLinkedToOtherTenants(organizationId, this.adSession)) { base.WriteError(new OrganizationValidationException(Strings.RemoveOrganizationFailWithSharedConfigurationBacklinks), (ErrorCategory)1000, this.Identity); } if (base.IsMSITTenant(organizationId)) { this.authoritativeOnly = true; } TaskLogger.LogExit(); }