<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="Topology" type="Microsoft.Exchange.Directory.TopologyService.Configuration.ServiceConfigurationSection,Microsoft.Exchange.Directory.TopologyService" allowLocation="true" allowDefinition="Everywhere" />
  </configSections>
  <runtime>
    <generatePublisherEvidence enabled="false"/>
  </runtime>
  <system.serviceModel>
    <bindings>
      <netTcpBinding>
        <binding name = "TopologyServiceBinding"
                 closeTimeout = "00:01:00"
                 openTimeout = "00:01:00"
                 receiveTimeout = "00:10:00"
                 sendTimeout = "00:02:00"
                 transactionFlow = "false"
                 transferMode = "Buffered"
                 transactionProtocol = "OleTransactions"
                 hostNameComparisonMode = "StrongWildcard"
                 maxBufferPoolSize = "524288"
                 maxBufferSize = "65536"
                 maxReceivedMessageSize = "65536"
                 maxConnections="100000"
                 listenBacklog="1000">
          <reliableSession
            ordered = "true"
            inactivityTimeout = "00:10:00"
            enabled = "false" />
          <readerQuotas maxStringContentLength="10485760" />
          <security mode = "Transport">
            <transport protectionLevel = "EncryptAndSign" clientCredentialType = "Windows"/>
          </security>
        </binding>
      </netTcpBinding>
      <netNamedPipeBinding>
        <binding name="DirectoryCache" 
                 closeTimeout="00:00:10" 
                 openTimeout="00:00:10"
                 receiveTimeout="00:00:10" 
                 sendTimeout="00:00:10" 
                 transactionFlow="false"
                 transferMode="Buffered" 
                 transactionProtocol="OleTransactions"
                 hostNameComparisonMode="StrongWildcard" 
                 maxBufferPoolSize="10485760"
                 maxBufferSize="10485760" 
                 maxConnections="100000"
                 maxReceivedMessageSize="10485760">
            <readerQuotas maxStringContentLength="10485760" />
            <security mode="None"/>
          </binding>
      </netNamedPipeBinding>
    </bindings>
    <services>
      <service name="Microsoft.Exchange.Directory.TopologyService.TopologyService" behaviorConfiguration="TopologyServiceBehavior">
        <endpoint name="tcpEndpoint"
            address="net.tcp://localhost:890/Microsoft.Exchange.Directory.TopologyService"
            binding="netTcpBinding"
            contract="Microsoft.Exchange.Directory.TopologyService.ITopologyService"
            bindingConfiguration="TopologyServiceBinding" />
      </service>
      <service name="Microsoft.Exchange.Data.Directory.Cache.DirectoryCacheService" behaviorConfiguration="CacheServiceBehavior">
        <endpoint name = "CacheNamedPipeEndPoint"
            address = "net.pipe://localhost/DirectoryCache/service.svc"
            binding = "netNamedPipeBinding" 
            contract = "Microsoft.Exchange.Data.Directory.Cache.IDirectoryCacheService"
            bindingConfiguration ="DirectoryCache" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="TopologyServiceBehavior">
          <serviceDebug includeExceptionDetailInFaults="true" />
          <dataContractSerializer maxItemsInObjectGraph="262144"/>
          <serviceThrottling
              maxConcurrentInstances="2147483647"
              maxConcurrentCalls="10000"
              maxConcurrentSessions="1000"
          />
        </behavior>
        <behavior name="CacheServiceBehavior">
          <serviceDebug includeExceptionDetailInFaults="true" />
          <dataContractSerializer maxItemsInObjectGraph="262144"/>
          <serviceThrottling
              maxConcurrentInstances="2147483647"
              maxConcurrentCalls="10000"
              maxConcurrentSessions="1000"
          />
         </behavior>
      </serviceBehaviors>
    </behaviors>
    <diagnostics performanceCounters="All" />
  </system.serviceModel>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>
  <appSettings>
    <add key="SendEventLogsWithWatsonReport" value="True" />
  </appSettings>
  <Topology MinimumPrefixMatch = "2"
            FullTopologyDiscoveryTimeout = "00:05:00"
            UrgentOrInitialTopologyTimeout = "00:05:00"
            DiscoveryFrequency = "00:15:00"
            DiscoveryFrequencyOnNoTopology = "00:00:30"
            DiscoveryFrequencyOnFailure = "00:05:00"
            DiscoveryFrequencyOnMinPercentageDC = "00:05:00"
            WaitTimeBetweenInitialAndFullDiscovery = "00:00:30"
            ForestScanFrequency = "00:06:00"
            ForestScanFrequencyOnFailure = "00:30:00"
            ForestScanTimeout = "00:05:00"
            SiteMonitorFrequency = "00:15:00"
            SiteMonitorFrequencyOnFailure = "00:05:00"
            SiteMonitorTimeout = "00:05:00"
            MaxRemoteForestDiscoveryErrorsPerHour = "25"
            RemoteDomainSingleServerDiscoveryTimeout = "00:05:00"
            ThrottleOnFullQueue = "00:00:30"
            ThrottleOnEmptyQueue = "00:01:00"
            MaxRunningTasks = "40"
            WaitAmountBeforeRestartRequest ="00:00:15"
            LocalIPAddressesCacheRefreshInterval = "24:00:00"
            ExchangeTopologyCacheLifetime = "04:00:00,00:20:00"
            ExchangeTopologyCacheFrequency = "01:00:00,00:05:00"
            MinPercentageOfHealthyDC = "50"
            EnableWholeForestDiscovery = "true" 
            ForestWideAffinityRequested = "true"/>

  <system.runtime.caching>
    <memoryCache>
      <namedCaches>
          <add name="KeyTable" 
               cacheMemoryLimitMegabytes="30" 
               physicalMemoryLimitPercentage="0"
               pollingInterval="00:05:00" />
          <add name="ADObjectCache" 
               cacheMemoryLimitMegabytes="300" 
               physicalMemoryLimitPercentage="0"
               pollingInterval="00:05:00" />
      </namedCaches>
    </memoryCache>
  </system.runtime.caching>
</configuration>
