protected override void OnFill(DataTable table)
        {
            this.Command.CommandType = CommandType.Text;
            object[] array = this.Command.Execute();
            TransportConfigContainer transportConfigContainer = null;
            int num = array.Length;

            if (num == 1)
            {
                transportConfigContainer = (array[0] as TransportConfigContainer);
            }
            if (transportConfigContainer != null && transportConfigContainer.SupervisionTags != null)
            {
                table.BeginLoadData();
                foreach (string text in transportConfigContainer.SupervisionTags)
                {
                    if (this.MatchFilter(text))
                    {
                        table.Rows.Add(new object[]
                        {
                            text,
                            new Word(text)
                        });
                    }
                }
                table.EndLoadData();
            }
        }
Example #2
0
        // Token: 0x0600067D RID: 1661 RVA: 0x00031744 File Offset: 0x0002F944
        protected override bool QueryIsEnabled()
        {
            if (!Datacenter.IsMultiTenancyEnabled())
            {
                EHAQuotaWarningEnforcer.Tracer.TraceDebug <EHAQuotaWarningEnforcer>((long)this.GetHashCode(), "{0}: All the checks below make sense only for DC and not for enterprise.", this);
                return(false);
            }
            if (!base.MailboxDataForTags.ElcUserInformation.ProcessEhaMigratedMessages)
            {
                EHAQuotaWarningEnforcer.Tracer.TraceDebug <EHAQuotaWarningEnforcer>((long)this.GetHashCode(), "{0}: Organization's ProcessEhaMigratedMessages settings is set to false. This mailbox will not be processed for migration messages", this);
                return(false);
            }
            TransportConfigContainer tenantTransportConfig = EHAQuotaWarningEnforcer.GetTenantTransportConfig(base.MailboxDataForTags.ElcUserTagInformation.ADUser.OrganizationId, this);

            if (tenantTransportConfig != null && !tenantTransportConfig.LegacyArchiveJournalingEnabled)
            {
                EHAQuotaWarningEnforcer.Tracer.TraceDebug <EHAQuotaWarningEnforcer>((long)this.GetHashCode(), "{0}: EHA Migration is already complete for this tenant, Skip Quota enforcer check.", this);
                return(false);
            }
            if (base.MailboxDataForTags.MailboxSession.MailboxOwner.MailboxInfo.IsArchive)
            {
                EHAQuotaWarningEnforcer.Tracer.TraceDebug <EHAQuotaWarningEnforcer>((long)this.GetHashCode(), "{0}: This is archive mailbox. This mailbox will not be processed for migration messages", this);
                return(false);
            }
            if (!this.IsMailboxInteresting())
            {
                EHAQuotaWarningEnforcer.Tracer.TraceDebug <EHAQuotaWarningEnforcer>((long)this.GetHashCode(), "{0}: This is not one of the eha mailboxes : journal ndr or confirmation mailbox. This mailbox will be skipped.", this);
                return(false);
            }
            return(true);
        }
Example #3
0
 private int GetTextScanLimit()
 {
     return(base.ProvisioningCache.TryAddAndGetOrganizationData <int>(CannedProvisioningCacheKeys.TransportRuleAttachmentTextScanLimitCacheKey, base.CurrentOrganizationId, delegate()
     {
         TransportConfigContainer transportConfigContainer = this.ConfigurationSession.FindSingletonConfigurationObject <TransportConfigContainer>();
         return (transportConfigContainer != null) ? ((int)transportConfigContainer.TransportRuleAttachmentTextScanLimit.ToBytes()) : 15728640;
     }));
 }
Example #4
0
 protected override void InternalStateReset()
 {
     base.InternalStateReset();
     if (this.IncludeE14Servers.ToBool() || !this.Mtrt.ToBool())
     {
         this.session = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(true, ConsistencyMode.IgnoreInvalid, ADSessionSettings.FromRootOrgScopeSet(), 330, "InternalStateReset", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\transport\\Queueviewer\\GetQueueDigest.cs");
         TransportConfigContainer transportConfigContainer = this.session.FindSingletonConfigurationObject <TransportConfigContainer>();
         Server server = this.session.FindLocalServer();
         this.impl = new GetQueueDigestWebServiceImpl(new GetQueueDigestCmdletAdapter(this), this.session, server.ServerSite, transportConfigContainer.DiagnosticsAggregationServicePort);
         return;
     }
     this.impl = new GetQueueDigestMtrtImpl(this);
 }
Example #5
0
 private static ADOperationResult GetTransportSettings()
 {
     return(ADNotificationAdapter.TryRunADOperation(delegate()
     {
         ITopologyConfigurationSession topologyConfigurationSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(true, ConsistencyMode.IgnoreInvalid, ADSessionSettings.FromRootOrgScopeSet(), 219, "GetTransportSettings", "f:\\15.00.1497\\sources\\dev\\Management\\src\\ServiceHost\\Servicelets\\DiagnosticsAggregation\\Program\\DiagnosticsAggregationServicelet.cs");
         TransportConfigContainer transportConfigContainer = topologyConfigurationSession.FindSingletonConfigurationObject <TransportConfigContainer>();
         if (transportConfigContainer != null)
         {
             DiagnosticsAggregationServicelet.transportSettings = transportConfigContainer;
             return;
         }
         throw new TenantTransportSettingsNotFoundException("First Org");
     }));
 }
Example #6
0
        public void ApplySecurityAttributesTo(TransportMailItem mailitem)
        {
            TransportConfigContainer transportConfigObject = Configuration.TransportConfigObject;

            if (this.GetPropValue <bool>(MessageItemSchema.ClientSubmittedSecurely, false))
            {
                MultilevelAuth.EnsureSecurityAttributes(mailitem, SubmitAuthCategory.Internal, MultilevelAuthMechanism.SecureMapiSubmit, null);
                return;
            }
            if (transportConfigObject.VerifySecureSubmitEnabled)
            {
                MultilevelAuth.EnsureSecurityAttributes(mailitem, SubmitAuthCategory.Anonymous, MultilevelAuthMechanism.MapiSubmit, null);
                return;
            }
            MultilevelAuth.EnsureSecurityAttributes(mailitem, SubmitAuthCategory.Internal, MultilevelAuthMechanism.MapiSubmit, null);
        }
        private CultureInfo GetNotificationEmailFallbackLanguage()
        {
            TransportConfigContainer transportConfigContainer = this.ConfigurationSession.FindSingletonConfigurationObject <TransportConfigContainer>();

            if (transportConfigContainer == null)
            {
                return(CultureInfo.CurrentUICulture);
            }
            CultureInfo result;

            if ((result = transportConfigContainer.InternalDsnDefaultLanguage) == null)
            {
                result = (transportConfigContainer.ExternalDsnDefaultLanguage ?? CultureInfo.CurrentUICulture);
            }
            return(result);
        }
        private void DetermineMaxMessageSize(TransportConfigContainer transportConfiguration, ADRawEntry sender)
        {
            if (transportConfiguration.MaxSendSize.IsUnlimited)
            {
                this.maxMessageSize = int.MaxValue;
            }
            else
            {
                this.maxMessageSize = (int)transportConfiguration.MaxSendSize.Value.ToBytes();
            }
            MailTipsConfiguration.GetMailTipsConfigurationTracer.TraceDebug <int>((long)this.traceId, "Organization's max message size is ", this.maxMessageSize);
            Unlimited <ByteQuantifiedSize> unlimited = (Unlimited <ByteQuantifiedSize>)sender[ADRecipientSchema.MaxSendSize];

            if (!unlimited.IsUnlimited)
            {
                this.maxMessageSize = (int)unlimited.Value.ToBytes();
                MailTipsConfiguration.GetMailTipsConfigurationTracer.TraceDebug <int>((long)this.traceId, "Recipient's max message size is ", this.maxMessageSize);
            }
        }
Example #9
0
        private void CheckTagValidForRecipientOrg(out ADObjectId configContainerId)
        {
            IConfigurationSession configurationSession = this.ConfigurationSession;
            ADObjectId            rootId;

            if (this.DataObject.OrganizationId == OrganizationId.ForestWideOrgId)
            {
                rootId = configurationSession.GetOrgContainerId();
            }
            else
            {
                rootId = this.DataObject.OrganizationId.ConfigurationUnit;
            }
            TransportConfigContainer[] array = configurationSession.Find <TransportConfigContainer>(rootId, QueryScope.SubTree, null, null, 2);
            if (array == null || array.Length == 0)
            {
                base.WriteError(new ManagementObjectNotFoundException(Strings.ExceptionObjectNotFound(typeof(TransportConfigContainer).ToString())), (ErrorCategory)1003, null);
            }
            if (array.Length > 1)
            {
                base.WriteError(new ManagementObjectAmbiguousException(Strings.ExceptionObjectAmbiguous(typeof(TransportConfigContainer).ToString())), (ErrorCategory)1003, null);
            }
            TransportConfigContainer transportConfigContainer = array[0];
            bool flag = false;

            foreach (string value in transportConfigContainer.SupervisionTags)
            {
                if (this.Tag.Equals(value, StringComparison.OrdinalIgnoreCase))
                {
                    flag = true;
                    break;
                }
            }
            if (!flag)
            {
                base.WriteError(new RecipientTaskException(Strings.ErrorSupervisionTagNotValid(this.Tag)), (ErrorCategory)1000, null);
            }
            configContainerId = transportConfigContainer.Id;
        }
        // Token: 0x06001560 RID: 5472 RVA: 0x0007D5CC File Offset: 0x0007B7CC
        protected void ParseMimeToMessage(MessageItem message)
        {
            if (message == null)
            {
                base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "ItemCreationFailed");
                throw new AirSyncPermanentException(HttpStatusCode.InternalServerError, StatusCode.MailSubmissionFailed, null, false);
            }
            Stream stream;

            if (base.Version < 140)
            {
                stream = base.InputStream;
            }
            else
            {
                AirSyncBlobXmlNode airSyncBlobXmlNode = base.Request.CommandXml["Mime"] as AirSyncBlobXmlNode;
                stream = airSyncBlobXmlNode.Stream;
                stream.Seek(0L, SeekOrigin.Begin);
            }
            InboundConversionOptions inboundConversionOptions = AirSyncUtility.GetInboundConversionOptions();

            inboundConversionOptions.ClearCategories = false;
            try
            {
                ItemConversion.ConvertAnyMimeToItem(message, stream, inboundConversionOptions);
            }
            catch (ExchangeDataException innerException)
            {
                base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "InvalidCharSetError");
                throw new AirSyncPermanentException(HttpStatusCode.BadRequest, StatusCode.InvalidMIME, innerException, false);
            }
            catch (ConversionFailedException innerException2)
            {
                base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "SendMailMimeError");
                throw new AirSyncPermanentException(HttpStatusCode.BadRequest, StatusCode.InvalidMIME, innerException2, false);
            }
            message.From = null;
            IConfigurationSession    tenantOrTopologyConfigurationSession = DirectorySessionFactory.Default.GetTenantOrTopologyConfigurationSession(ConsistencyMode.IgnoreInvalid, ADSessionSettings.FromOrganizationIdWithoutRbacScopesServiceOnly(Command.CurrentOrganizationId), 854, "ParseMimeToMessage", "f:\\15.00.1497\\sources\\dev\\AirSync\\src\\AirSync\\SendMailBase.cs");
            TransportConfigContainer transportConfigContainer             = tenantOrTopologyConfigurationSession.FindSingletonConfigurationObject <TransportConfigContainer>();

            base.ProtocolLogger.SetValue(ProtocolLoggerData.DomainController, tenantOrTopologyConfigurationSession.LastUsedDc);
            bool flag = transportConfigContainer == null || !transportConfigContainer.OpenDomainRoutingEnabled;

            if (flag && SendMailBase.DefaultDomain != null)
            {
                IList <Recipient> list = new List <Recipient>();
                foreach (Recipient recipient in message.Recipients)
                {
                    if (recipient.Participant.RoutingType == null || (recipient.Participant.RoutingType == "SMTP" && recipient.Participant.EmailAddress.IndexOf('@') == -1))
                    {
                        list.Add(recipient);
                    }
                }
                foreach (Recipient recipient2 in list)
                {
                    Participant participant = this.ResolveUnresolvedParticipant(recipient2.Participant);
                    message.Recipients.Remove(recipient2);
                    message.Recipients.Add(participant, recipient2.RecipientItemType);
                }
                IList <Participant> list2 = new List <Participant>();
                foreach (Participant participant2 in message.ReplyTo)
                {
                    if (participant2.RoutingType == null || (participant2.RoutingType == "SMTP" && participant2.EmailAddress.IndexOf('@') == -1))
                    {
                        list2.Add(participant2);
                    }
                }
                foreach (Participant participant3 in list2)
                {
                    Participant item = this.ResolveUnresolvedParticipant(participant3);
                    message.ReplyTo.Remove(participant3);
                    message.ReplyTo.Add(item);
                }
            }
            if (message.Recipients.Count == 0)
            {
                base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "MessageHasNoRecipient");
                throw new AirSyncPermanentException(HttpStatusCode.InternalServerError, StatusCode.MessageHasNoRecipient, null, false);
            }
        }
Example #11
0
        private void HostService()
        {
            ExTraceGlobals.DiagnosticsAggregationTracer.TraceDebug(0L, "DiagnosticsAggregationServicelet HostService started.");
            DiagnosticsAggregationServicelet.log.Start(DiagnosticsAggregationServicelet.config);
            if (!DiagnosticsAggregationServicelet.TryReadAdObjects())
            {
                return;
            }
            ServiceHost serviceHost = null;

            try
            {
                this.RegisterForChangeNotifications();
                if (!this.TryHostDiagnosticsWebService(false, out serviceHost))
                {
                    return;
                }
                this.StartPeriodicDagAggregation();
                while (!base.StopEvent.WaitOne(TimeSpan.FromMinutes(1.0)))
                {
                    if (DiagnosticsAggregationServicelet.transportSettingsChanged)
                    {
                        DiagnosticsAggregationServicelet.transportSettingsChanged = false;
                        TransportConfigContainer transportConfigContainer = DiagnosticsAggregationServicelet.TransportSettings;
                        if (DiagnosticsAggregationServicelet.GetTransportSettings() != ADOperationResult.Success)
                        {
                            DiagnosticsAggregationServicelet.Log.Log(DiagnosticsAggregationEvent.ServiceletError, "Fetching transport settings failed", new object[0]);
                        }
                        else if (transportConfigContainer.DiagnosticsAggregationServicePort != DiagnosticsAggregationServicelet.TransportSettings.DiagnosticsAggregationServicePort)
                        {
                            DiagnosticsAggregationServicelet.Log.Log(DiagnosticsAggregationEvent.Information, "Webservice port is changed from {0} to {1}. Hosting the webservice with the new bindings.", new object[]
                            {
                                transportConfigContainer.DiagnosticsAggregationServicePort,
                                DiagnosticsAggregationServicelet.TransportSettings.DiagnosticsAggregationServicePort
                            });
                            ServiceHost serviceHost2 = null;
                            if (this.TryHostDiagnosticsWebService(true, out serviceHost))
                            {
                                ServiceHost client = serviceHost;
                                serviceHost = serviceHost2;
                                WcfUtils.DisposeWcfClientGracefully(client, false);
                            }
                            else
                            {
                                DiagnosticsAggregationServicelet.Log.Log(DiagnosticsAggregationEvent.ServiceletError, "Hosting the webservice with new bindings did not succeed.", new object[0]);
                            }
                        }
                        else
                        {
                            DiagnosticsAggregationServicelet.Log.Log(DiagnosticsAggregationEvent.Information, "Webservice port did not change.", new object[0]);
                        }
                    }
                }
            }
            finally
            {
                if (DiagnosticsAggregationServicelet.groupQueuesDataProvider != null)
                {
                    DiagnosticsAggregationServicelet.groupQueuesDataProvider.Stop();
                }
                if (DiagnosticsAggregationServicelet.localQueuesDataProvider != null)
                {
                    DiagnosticsAggregationServicelet.localQueuesDataProvider.Stop();
                }
                WcfUtils.DisposeWcfClientGracefully(serviceHost, false);
                this.UnregisterADNotifications();
                DiagnosticsAggregationServicelet.log.Stop();
            }
            ExTraceGlobals.DiagnosticsAggregationTracer.TraceDebug(0L, "HostService Stopped.");
        }
        private void Discover(ExchangePrincipal principal, ADUser executingUser, out string ewsEndpoint, out DelegationTokenRequest ewsTokenRequest)
        {
            SmtpAddress              value           = principal.MailboxInfo.RemoteIdentity.Value;
            ADSessionSettings        sessionSettings = ADSessionSettings.FromOrganizationIdWithoutRbacScopesServiceOnly(OrganizationId.ForestWideOrgId);
            IRecipientSession        tenantOrRootOrgRecipientSession = DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession(null, true, ConsistencyMode.FullyConsistent, null, sessionSettings, ConfigScopes.TenantSubTree, 168, "Discover", "f:\\15.00.1497\\sources\\dev\\data\\src\\storage\\Search\\MailboxSearch\\MailboxSearchEwsClient.cs");
            ADUser                   aduser = null;
            TransportConfigContainer transportConfigContainer = DirectorySessionFactory.Default.GetTenantOrTopologyConfigurationSession(true, ConsistencyMode.IgnoreInvalid, sessionSettings, 171, "Discover", "f:\\15.00.1497\\sources\\dev\\data\\src\\storage\\Search\\MailboxSearch\\MailboxSearchEwsClient.cs").FindSingletonConfigurationObject <TransportConfigContainer>();

            if (transportConfigContainer != null && transportConfigContainer.OrganizationFederatedMailbox != SmtpAddress.NullReversePath)
            {
                SmtpAddress  organizationFederatedMailbox = transportConfigContainer.OrganizationFederatedMailbox;
                ProxyAddress proxyAddress = null;
                try
                {
                    proxyAddress = ProxyAddress.Parse(organizationFederatedMailbox.ToString());
                }
                catch (ArgumentException ex)
                {
                    ExTraceGlobals.SessionTracer.TraceError <string>((long)this.GetHashCode(), "Proxy address of organization federated mailbox is invalid: {0}", ex.ToString());
                }
                if (proxyAddress != null && !(proxyAddress is InvalidProxyAddress))
                {
                    aduser = (tenantOrRootOrgRecipientSession.FindByProxyAddress(proxyAddress) as ADUser);
                }
            }
            OrganizationIdCacheValue organizationIdCacheValue = OrganizationIdCache.Singleton.Get(OrganizationId.ForestWideOrgId);
            OrganizationRelationship organizationRelationship = organizationIdCacheValue.GetOrganizationRelationship(value.Domain);

            if (aduser == null || organizationRelationship == null)
            {
                throw new OrganizationNotFederatedException();
            }
            DelegationTokenRequest request = new DelegationTokenRequest
            {
                FederatedIdentity = aduser.GetFederatedIdentity(),
                EmailAddress      = aduser.GetFederatedSmtpAddress().ToString(),
                Target            = organizationRelationship.GetTokenTarget(),
                Offer             = Offer.Autodiscover
            };
            FedOrgCredentials credentials = new FedOrgCredentials(request, this.GetSecurityTokenService(aduser.OrganizationId));
            Uri uri = null;

            using (AutoDiscoverUserSettingsClient autoDiscoverUserSettingsClient = AutoDiscoverUserSettingsClient.CreateInstance(DirectorySessionFactory.Default.CreateTopologyConfigurationSession(ConsistencyMode.IgnoreInvalid, sessionSettings, 215, "Discover", "f:\\15.00.1497\\sources\\dev\\data\\src\\storage\\Search\\MailboxSearch\\MailboxSearchEwsClient.cs"), credentials, value, organizationRelationship.TargetAutodiscoverEpr, MailboxSearchEwsClient.AutoDiscoverRequestedSettings))
            {
                UserSettings  userSettings  = autoDiscoverUserSettingsClient.Discover();
                StringSetting stringSetting = userSettings.GetSetting("ExternalEwsUrl") as StringSetting;
                if (stringSetting == null || !Uri.TryCreate(stringSetting.Value, UriKind.Absolute, out uri))
                {
                    throw new AutoDAccessException(ServerStrings.AutoDRequestFailed);
                }
            }
            ewsEndpoint = EwsWsSecurityUrl.Fix(uri.ToString());
            string text = null;

            if (executingUser.EmailAddresses != null && executingUser.EmailAddresses.Count > 0)
            {
                List <string> federatedEmailAddresses = executingUser.GetFederatedEmailAddresses();
                if (federatedEmailAddresses != null && federatedEmailAddresses.Count > 0)
                {
                    text = federatedEmailAddresses[0];
                }
            }
            if (string.IsNullOrEmpty(text))
            {
                ewsTokenRequest = new DelegationTokenRequest
                {
                    FederatedIdentity = aduser.GetFederatedIdentity(),
                    EmailAddress      = aduser.GetFederatedSmtpAddress().ToString(),
                    Target            = organizationRelationship.GetTokenTarget(),
                    Offer             = Offer.MailboxSearch
                };
                return;
            }
            ewsTokenRequest = new DelegationTokenRequest
            {
                FederatedIdentity = executingUser.GetFederatedIdentity(),
                EmailAddress      = text.ToString(),
                Target            = organizationRelationship.GetTokenTarget(),
                Offer             = Offer.MailboxSearch
            };
        }
Example #13
0
 public JournalReportNdrTo(TransportConfigContainer container) : base(null, container)
 {
     this.MyContainer = container;
 }
Example #14
0
        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();
        }