<?xml version="1.0"?>
<configuration>
  <!-- 
      Configuration section for Exchange Control Panel:
  
     - rbacPrincipalMaximumAge: TimeSpan: Ex: 00:15:00 - 15 minutes.
       Controls for how long we cache RBAC information for a particular identity. 
       This timeout is absolute, ie, it will expire even if the user is constantly using it.
       This allows administrators to control for how long a user can run ECP with
       out-of-date role assignments.
       
     - rbacRunspaceSlidingExpiration: TimeSpan: Ex: 00:05:00 - 5 minutes.
       Controls for how long we keep RBAC runspaces cached for a particular identity.
       This timeout slides, ie, each time the user accesses his runspace we will let
       the runspace live for this much longer. 
       
       Note that when the RbacPrincipal reaches its maximum age it will forcefully 
       expire and will take the associated runspaces with it, so 
       rbacRunspaceSlidingExpiration needs to be less than or equal to 
       rbacPrincipalMaximumAge.
       
       Performance of the server can be tweaked between these two properties.
       Increasing the timeouts allows the server to cache RBAC information
       and runspaces for longer periods, therefore responding faster to returning
       users at the cost of memory and a delay in automatically picking up changes 
       in role assignments. Note that users can force a refresh of their RBAC
       information by creating new session (ie, opening new browser windows).
       
  <configSections>
    <section name="rbacConfig" type="Microsoft.Exchange.PowerShell.RbacHostingTools.Asp.Net.RbacSection, Microsoft.Exchange.PowerShell.RbacHostingTools" restartOnExternalChanges="true"/>
  </configSections>
  <rbacConfig rbacPrincipalMaximumAge="00:15:00" rbacRunspaceSlidingExpiration="00:05:00"/>
  -->
  <configSections>
    <section name="GlobalInfos" type="Microsoft.Exchange.Management.ControlPanel.GlobalInfoHandler" restartOnExternalChanges="true"/>
    <section name="csmsdk" type="Microsoft.Office.CsmSdk.CsmSdkSection, Microsoft.Office.CsmSdk" allowDefinition="Everywhere" allowExeDefinition="MachineToApplication" restartOnExternalChanges="true" />
  </configSections>
 
  <appSettings>
    <!-- Provisioning Cache identification -->
    <add key="ProvisioningCacheIdentification" value="Ecp" />
    <!-- Set LogPerformanceData to "true" to log ECP's performance records to the IIS log: -->
    <add key="LogPerformanceData" value="false" />
    <!-- Set ShowPerformanceConsole to "true" to show ECP's Perf Console: -->
    <add key="ShowPerformanceConsole" value="false" />
    <!-- How many performance records to queue until the perf console is launched (Effective only if ShowPerformanceConsole is true): -->
    <add key="MaxQueuedPerfRecords" value="50" />
    <!-- If set to "true", we'll edit error messages from cmdlets before showing them, so we can identify if they came from tasks or are internal to ECP. -->
    <add key="AddSourceToErrorMessages" value="false" />
    <!-- Specify the directories to probe binaries, separate each path by a semicolon  -->
    <add key="BinSearchFolders" value="%ExchangeInstallDir%bin;%ExchangeInstallDir%bin\CmdletExtensionAgents;%ExchangeInstallDir%ClientAccess\Owa\bin" />
    <!-- A tri-state switch indicating whether we want to show debug information such as call stack of exception. 
           However, note that client javascript callstack will always be shown.
           It accepts the following values, default is None:
               All:     Always show debug information for all errors.
               Unkown:  Debug infor is shown only for some unknown errors. For other errors, we hide the debug infor for security or user-friendly purposes.
               None:    Always hide server debug information.
    -->
    <add key="ShowDebugInformation" value="None" />
    <!-- Time span to force SecurityToken expire -->
    <add key="DelegatedAutentication.TokenLifetime" value="01:00:00" />
    <!-- Flag to turn on Rehydration for SidOAuthIdentity, required by DelegatedAuthenticationModule for OAuth -->
    <add key="OAuthAuthenticator.RehydrateSidOAuthIdentity" value="true" />
    <add key="OAuthHttpModule.Profiles" value="S2SAppActAs"/>
    <add key="OAuthHttpModule.AddToHttpContextItems" value="true" />
    <add key="OAuthHttpModule.AddToRequestHeaders" value="true" />
    <add key="OAuthHttpModule.RunningAtBackend" value="true" />
    <!-- By default return to original url when redirect to other site for re-auth or token renew -->
    <add key="ReturnToOringinalUrlByDefault" value="False" />
    <!-- Time span to renew organization cache -->
    <add key="OrgCacheLifetimeInMinute" value="30" />
    <!-- Maximum identities for Multiple Object Execute -->
    <add key="MaximumIdentities" value="500" />
    <!-- Hybrid Server URL 0 -->
    <add key="HybridServerUrl0" value="https://outlook.office365.com/ecp/" />
    <!-- Hybrid Server URL 1 -->
    <add key="HybridServerUrl1" value="https://partner.outlook.cn/ecp/" />
    <!-- OAuth configuration requires E15 SP1 or greater on all on-prem machines (for service instance 0) -->
    <add key="RestrictIOCToSP1OrGreater0" value="true" />
    <!-- OAuth configuration requires E15 SP1 or greater on all on-prem machines (for service instance 1) -->
    <add key="RestrictIOCToSP1OrGreater1" value="false" />
    <!-- Hybrid Synchronizing Timeout In Seconds. The ent hybrid page will be redirected to error page after timeout. -->
    <add key="HybridSyncTimeoutInSeconds" value="90" />
    <!-- By default the side bar refresh interval in millisecond-->
    <!-- Client Instrumentation Enable Probability settings. Data range is 0.0 - 1.0, 0.0 means disable and 1.0 means enable for all client -->
    <add key="ClientInstrumentationProbability" value="0.0" />
    <!-- Client Instrumentation Upload Duration. By default, it will upload log after 55 seconds just after the datapoint buffer is not empty -->
    <add key="ClientInstrumentationUploadDuration" value="55" />   
    <!--Office365 NavBar resources-->
    <add key="ShellServiceEndPointConfiguration" value="MsOnlineShellService_EndPointConfiguration" />
    <!-- Specify snapin set. Possible values are 'OSP', 'Admin'. Empty value will default to 'Admin'.  -->
    <add key="ExchangeRunspaceConfigurationSnapinSet" value="" />
    <!-- Specify the additional Global Application that has to called on Application_Start and Application_End -->
    <add key="ExtendedApplications" value="" />
    <!-- Set this attribute to true to enable EAC resilience retry logic -->
    <add key="ResilienceEnabled" value="true" />
    <!-- This is a white list including the pages which can be hosted cross domain. For security consideration, don't change it if unnecessary -->
    <add key="IframeablePagesForOnPremises" value="~/error.aspx,~/hybridlogouthelper.aspx" />
    <add key="IframeablePagesForDataCenter" value="" />
    <!-- Account termination check settings -->
    <add key="AccountTerminationEnabled" value="false" />    
  </appSettings>

  <!-- By default, the size limit of web.config is 250K. It's safe to add global data -->
  <!-- Please read this article http://support.microsoft.com/kb/954864 get more information for web.config -->
  <GlobalInfos>
    <GlobalInfo lang="fa-IR,ms-BN,gu-IN,bn-IN,ar-JO,ar-LW,ar-SA,ur-PK,ta-IN,te-IN,th-TH,tr-TR,es-SV,es-NI,es-PR,es-US,fr-IR,or-IN,mr-IN,ml-IN,en-US,en-AU,en-CA,en-IE,en-NZ,en-ZA,am-ET,fr-CA,hi-IN,id-ID,kn-IN,sw-KE,lv-LV,lt-LT"
       name="FirstName,Initials,LastName" address="Street,City,StateProvince,ZipPostal,Country"/>
    <GlobalInfo lang="sv-FI,sv-SE,es-UY,es-VE,es-GT,es-HN,es-MX,es-PA,es-PY,es-PE,es-ES,es-CL,es-CO,es-CR,es-DO,es-BO,es-EC,es-AR,it-IT,sl-SI,sk-SK,sr,pt-BR,pt-PT,ro-RO,pl-PL,nb-NO,ms-MY,it-CH,is-IS,eu-ES,el-GR,bg-BG,ca-ES,ar-DZ,ar-BH,ar-IQ,ar-KW,ar-LY,ar-MA,ar-QA,ar-SY,ar-TN,ar-AE,ar-YE,da-DK,nl-BE,nl-NL,en-BZ,en-JM,en-PH,en-TT,en-GB,en-ZW,et-EE,fi-PH,fi-FI,fr-BE,fr-FR,fr-LU,fr-MC,fr-CH,gl-ES,de-AT,de-DE,de-LI,de-LU,de-CH,fl-GR,he-IL"
       name="FirstName,Initials,LastName" address="Street,ZipPostal,City,StateProvince,Country"/>
    <GlobalInfo lang="ar-EG" name="FirstName,Initials,LastName" address="Street,Country,City,StateProvince,ZipPostal"/>
    <GlobalInfo lang="ar-OM" name="FirstName,Initials,LastName" address="Street,City,StateProvince,Country,ZipPostal"/>
    <GlobalInfo lang="zh-CN,zh-TW" name="LastName,FirstName" address="ZipPostal,Country,StateProvince,City,Street"/>
    <GlobalInfo lang="zh-SG" name="LastName,FirstName" address="Street,City,StateProvince,ZipPostal,Country"/>
    <GlobalInfo lang="zh-HK" name="LastName,FirstName" address="Country,ZipPostal,StateProvince,City,Street"/>
    <GlobalInfo lang="zh-MO" name="LastName,FirstName" address="Country,StateProvince,City,ZipPostal,Street"/>
    <GlobalInfo lang="hr-HR,cs-CZ" name="LastName,FirstName" address="Street,ZipPostal,City,StateProvince,Country"/>
    <GlobalInfo lang="hu-HU" name="LastName,FirstName" address="City,Street,ZipPostal,StateProvince,Country"/>
    <GlobalInfo lang="ja-JP,ko-KR" name="LastName,FirstName" address="ZipPostal,StateProvince,City,Street,Country"/>
    <GlobalInfo lang="kk-KZ" name="FirstName,Initials,LastName" address="Country,StateProvince,City,ZipPostal,Street"/>
    <GlobalInfo lang="ru-RU" name="FirstName,Initials,LastName" address="Country,ZipPostal,StateProvince,City,Street"/>
    <GlobalInfo lang="uk-UA" name="LastName,FirstName,Initials" address="Country,ZipPostal,StateProvince,City,Street"/>
    <GlobalInfo lang="cy-GB" name="FirstName,Initials,LastName" address="Street,City,StateProvince,ZipPostal,Country"/>
    <GlobalInfo lang="fil-PH" name="FirstName,Initials,LastName" address="Street,ZipPostal,StateProvince,City,Country"/>
  </GlobalInfos>

  <system.web>
    <machineKey validationKey="CB2721ABDAF8E9DC516D621D8B8BF13A2C9E8689A25303BF" decryptionKey="E9D2490BD0075B51D1BA5288514514AF" validation="SHA1" decryption="3DES"/>

    <!--
        Set client scripts location to version/scripts, so that request to WebRequest.axd will be replaced with this static path
    -->
    <webControls clientScriptsLocation="/ecp/15.0.995.28/scripts/" />

    <!-- 
	  Enable HTTPOnly flag for server generated cookies.
    We used to require secure (HTTPS) cookies too, but CAS-2-CAS scenarios can use just HTTP.
	  Please note that these settings can be overwritten programmatically. So we specify entries here just
	  to provide a default settings for all cookies.
	  -->
    <httpCookies httpOnlyCookies="true" domain=""/>

    <!--
    Use our AntiXssEncoder to replace the default HttpEncoder in ASP.Net.
    -->
    <httpRuntime requestValidationMode="2.0" encoderType="Microsoft.Exchange.Management.ControlPanel.AntiXssEncoder"/>

    <!-- If you add an custom error code here, make sure to update IsIntestingHttpException on ExceptionExtension -->
    <customErrors defaultRedirect="error.aspx" mode="RemoteOnly">
      <error statusCode="404" redirect="error.aspx?cause=urlnotfound"/>
    </customErrors>

    <globalization resourceProviderFactoryType="Microsoft.Exchange.Management.ControlPanel.EcpResourceProviderFactory"/>
    <compilation debug="false" defaultLanguage="C#">
      <assemblies>
        <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Web.Extensions.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="Microsoft.Exchange.Data.Common, Version=15.00.991.0, Culture=neutral, publicKeyToken=31bf3856ad364e35"/>
      </assemblies>
      <expressionBuilders>
        <!-- Enable markup expressions to reference localized strings from our Strings.locstrings file -->
        <add expressionPrefix="Strings" type="Microsoft.Exchange.Management.ControlPanel.StringsExpressionBuilder, Microsoft.Exchange.Management.ControlPanel"/>
        <add expressionPrefix="Regex" type="Microsoft.Exchange.Management.ControlPanel.RegexExpressionBuilder, Microsoft.Exchange.Management.ControlPanel"/>
        <!-- Enable markup expressions to reference dynamic value (which can be caculated on the fly for each http request) -->
        <add expressionPrefix="DynamicValue" type="Microsoft.Exchange.Management.ControlPanel.DynamicValueExpressionBuilder, Microsoft.Exchange.Management.ControlPanel"/>
      </expressionBuilders>
    </compilation>
    <!-- Specify the default theme applied to all pages -->
    <pages theme="default" validateRequest="true" enableEventValidation="false" enableSessionState="false" enableViewState="false" enableViewStateMac="true" autoEventWireup="false">
      <controls>
        <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        <add tagPrefix="ajaxToolkit" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"/>
        <add tagPrefix="ecp" namespace="Microsoft.Exchange.Management.ControlPanel" assembly="Microsoft.Exchange.Management.ControlPanel"/>
        <add tagPrefix="ecp" namespace="Microsoft.Exchange.Management.ControlPanel.WebControls" assembly="Microsoft.Exchange.Management.ControlPanel"/>
        <add tagPrefix="ecp" namespace="Microsoft.Exchange.Management.ControlPanel.Reporting" assembly="Microsoft.Exchange.Management.ControlPanel"/>
        <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add tagPrefix="CsmSdk" namespace="Microsoft.Office.CsmSdk.Controls" assembly="Microsoft.Office.CsmSdk"/>
      </controls>

      <tagMapping>
        <add tagType="System.Web.UI.WebControls.Label" mappedTagType="Microsoft.Exchange.Management.ControlPanel.EncodingLabel"/>
        <add tagType="System.Web.UI.WebControls.RadioButtonList" mappedTagType="Microsoft.Exchange.Management.ControlPanel.WebControls.EcpRadioButtonList"/>
        <add tagType="System.Web.UI.ScriptManagerProxy" mappedTagType="Microsoft.Exchange.Management.ControlPanel.WebControls.ScriptManagerProxy"/>
      </tagMapping>
    </pages>
    <!-- Deny anonymous access to all pages and require the user to have at least one of the role types -->
    <authorization>
      <allow roles="MyTeamMailboxes,MyBaseOptions,Admin"/>
      <deny users="*"/>
      <deny users="?"/>
    </authorization>
    <!-- Disable the standard role manager so we don't risk trying to access SQL databases for roles -->
    <roleManager enabled="false">
    </roleManager>
    <!-- Set default siteMap provider and turn on securityTrimmingEnabled switch -->
    <siteMap defaultProvider="EacSiteMapProvider" enabled="true">
      <providers>
        <add name="EacSiteMapProvider" description="Default SiteMap provider." type="Microsoft.Exchange.Management.ControlPanel.EacSiteMapProvider" siteMapFile="Web.sitemap" securityTrimmingEnabled="true"/>
      </providers>
    </siteMap>
    <xhtmlConformance mode="Strict"/>
    <!-- Set enabled to true to enable trace. Note that this is only enabled in debug build. -->
    <trace enabled="false" writeToDiagnosticsTrace="true" requestLimit="20" mostRecent="true" localOnly="true"/>
    <httpHandlers>
      <add path=".cxml" verb="GET" type="Microsoft.Exchange.Management.ControlPanel.Osp.OspPivotViewerDynamic.CxmlHandler" />
    </httpHandlers>
  </system.web>
  <system.webServer>
    <httpProtocol>
      <customHeaders>
        <!-- Specify IE10 Standards mode to ensure the web application is displayed consistently, even after updating the Internet Explorer. -->
        <!-- If we need to enable the features added in furture versions of Internet Explorer, we need to fix the possible compatible issues before change the compatible mode. -->
        <add name="X-UA-Compatible" value="IE=10"/>
      </customHeaders>
    </httpProtocol>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules>
      <!--For module whose type is not defined in Microsoft.Exchange.Management.ControlPanel.dll, the full type name including the assembly name should be specified.-->
      <remove name="Session" />
      <remove name="FormsAuthentication"/>
      <remove name="DefaultAuthentication"/>
      <remove name="RoleManager"/>
      <remove name="FileAuthorization"/>
      <remove name="AnonymousIdentification"/>
      <remove name="Profile"/>
      <remove name="UrlMappingsModule"/>
      <remove name="ServiceModel"/>
      <!-- ExWebHealthModule must always be the first one in the list -->
      <add name="ExWebHealthModule" type="Microsoft.Exchange.Common.ExWebHealthModule,Microsoft.Exchange.Common, Version=15.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      <add name="LiveIdBasicAuthModule" type="Microsoft.Exchange.Security.Authentication.LiveIdBasicAuthModule, Microsoft.Exchange.Security" preCondition="managedHandler" />
      <add name="OAuthAuthModule" type="Microsoft.Exchange.Security.OAuth.OAuthHttpModule, Microsoft.Exchange.Security" preCondition="managedHandler"/>
      <add name="DiagnosticsModule" type="Microsoft.Exchange.Management.ControlPanel.DiagnosticsModule" preCondition="managedHandler"/>
      <add name="PerformanceConsoleModule" type="Microsoft.Exchange.Management.ControlPanel.PerformanceConsoleModule" preCondition="managedHandler"/>
      <add name="BackendRehydrationModule" type="Microsoft.Exchange.Security.Authentication.BackendRehydrationModule, Microsoft.Exchange.Security" preCondition="managedHandler" />
      <add name="OrgIdAuthenticationModule" type="Microsoft.Exchange.Hygiene.Security.OrgIdAuthentication.OrgIdAuthenticationModule, Microsoft.Exchange.Hygiene.Security.OrgIdAuthentication" />
      <add name="RequestFilterModule" type="Microsoft.Exchange.Management.ControlPanel.RequestFilterModule" />
      <add name="DelegatedAuthModule" type="Microsoft.Exchange.Configuration.DelegatedAuthentication.DelegatedAuthenticationModule, Microsoft.Exchange.Configuration.DelegatedAuth" preCondition="managedHandler" />
      <add name="RbacModule" type="Microsoft.Exchange.Management.ControlPanel.RbacModule" preCondition="managedHandler"/>
      <add name="ClientAccessRulesModule" type="Microsoft.Exchange.Management.ControlPanel.ClientAccessRulesModule" preCondition="managedHandler"/>
      <add name="ErrorHandlingModule" type="Microsoft.Exchange.Management.ControlPanel.ErrorHandlingModule" preCondition="managedHandler"/>
      <!-- Remove all DataCenter only modules by default. They will be enabled by enable-LiveIDForWebApplication.ps1 -->
      <remove name="DelegatedAuthModule"/>
      <remove name="OrgIdAuthenticationModule"/>
      <remove name="LiveIdBasicAuthModule"/>
      <remove name="OAuthAuthModule"/>
    </modules>
    <handlers accessPolicy="Read, Script">
      <clear/>
      <add name="DownloadHandler" path="Download.aspx" verb="GET,POST" type="Microsoft.Exchange.Management.ControlPanel.DownloadHandler" preCondition="integratedMode" />
      <add name="GoHelpHandler" path="GoHelp.aspx" verb="GET" type="Microsoft.Exchange.Management.ControlPanel.GoHelpHandler" preCondition="integratedMode" />
      <add name="ProxyLogonHandler" path="proxyLogon.ecp" verb="POST" type="Microsoft.Exchange.Management.ControlPanel.ProxyLogonHandler" preCondition="integratedMode" />
      <add name="AuthenticationImageHandler" path="*.img" verb="GET" type="Microsoft.Exchange.Management.ControlPanel.AuthenticationImageHandler" preCondition="integratedMode" />
      <add name="svc-Integrated" path="*.svc" verb="POST" type="Microsoft.Exchange.Management.ControlPanel.WebServiceHandler" preCondition="integratedMode" />
      <add name="LiveIdErrorHandler" path="LiveIdError.aspx" verb="POST" type="System.Web.UI.PageHandlerFactory" preCondition="integratedMode" />
      <add name="EducationPage" path="Education.aspx" verb="POST" type="System.Web.UI.PageHandlerFactory" preCondition="integratedMode" />
      <add name="OrgIdErrorHandler" path="OrgIdError.aspx" verb="POST" type="System.Web.UI.PageHandlerFactory" preCondition="integratedMode" />
      <add name="PageHandlerFactory-Integrated" path="*.aspx" verb="GET" type="System.Web.UI.PageHandlerFactory" preCondition="integratedMode" />
      <add name="SlabHandler" path="*.slab" verb="GET" type="Microsoft.Exchange.Management.ControlPanel.SlabHandler" preCondition="integratedMode"/>
      <add name="ImportContactList" path="*/ImportContactList.aspx" verb="POST" type="System.Web.UI.PageHandlerFactory" preCondition="integratedMode" />
      <add name="AssemblyResourceLoader-Integrated" path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" preCondition="integratedMode" />
      <add name="Ashxhandler" path="*.ashx" verb="POST" type="System.Web.UI.SimpleHandlerFactory" preCondition="integratedMode" />
      <add name="StaticFile" path="*" verb="GET" modules="StaticFileModule,DefaultDocumentModule" resourceType="Either" requireAccess="Read" />
      <add name="UploadPolicyFromISV" path="*/ManagePolicyFromISV.aspx" verb="POST" type="System.Web.UI.PageHandlerFactory" preCondition="integratedMode" />
      <add name="EmailTemplatesHandler" path="OsiTemplateForAlertUpdateEmail*.aspx" verb="POST" type="System.Web.UI.PageHandlerFactory" preCondition="integratedMode" />
      <add name="OsiAttachmentsHandler" path="*AttachmentOperations.ashx" verb="GET,POST" type="System.Web.UI.SimpleHandlerFactory" preCondition="integratedMode" />
    </handlers>
    <staticContent>
      <clear/>
      <mimeMap fileExtension=".gif" mimeType="image/gif" />
      <mimeMap fileExtension=".png" mimeType="image/png" />
      <mimeMap fileExtension=".ico" mimeType="image/x-icon" />
      <mimeMap fileExtension=".css" mimeType="text/css" />
      <mimeMap fileExtension=".js" mimeType="application/x-javascript" />
      <mimeMap fileExtension=".eot" mimeType="application/octet-stream" />
      <mimeMap fileExtension=".ttf" mimeType="application/octet-stream" />
      <mimeMap fileExtension=".woff" mimeType="application/octet-stream" />
      <mimeMap fileExtension=".svg" mimeType="application/octet-stream" />
      <mimeMap fileExtension=".application" mimeType="application/x-ms-application" />
      <mimeMap fileExtension=".manifest" mimeType="application/x-ms-manifest" />
      <mimeMap fileExtension=".deploy" mimeType="application/octet-stream" />
    </staticContent>
  </system.webServer>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
        <providerOption name="CompilerVersion" value="v3.5"/>
        <providerOption name="WarnAsError" value="true"/>
      </compiler>
    </compilers>
  </system.codedom>
  <system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" minFreeMemoryPercentageToActivateService="0" />
    <bindings>
      <webHttpBinding>
        <!-- 
          ECP Web Services are auto-configured and do not need to be listed here. 
          However, their svc file must include the following setting to activate the correct host:
            Factory="Microsoft.Exchange.Management.ControlPanel.ServiceHostFactory"
            
          We auto-configure the bindings based on the schema of the endpoint address.
          HTTPS binding is used by the https://server/ecp base address and similarly the
          HTTP binding is used with the http://server/ecp base address. 
          
          Note that HTTP is primarily for use with CAS-2-CAS proxy scenarios and requires 
          the 'ecp' vdir to be configured to 'not' require SSL. In this case both endpoints
          are created. If the vdir is configured to require SSL then only the https endpoint
          is created.
          
          In below the maxStringContentLength explicitly defines the maximum length required 
          throughout ECP. For example, OOF is using this value in its rich text editor to restrict the content inside.
          Changing this number smaller may result in webservice failures.
          Increase maxReceivedMessageSize and maxReceivedMessageSize to 2M to support 50,000 mailboxes for migration CSV file.
          NOTES: maxReceivedMessageSize is in bytes.
          -->
        <binding name="https" maxReceivedMessageSize="2097152">
          <security mode="Transport"/>
          <readerQuotas maxStringContentLength="2097152" />
        </binding>
        <binding name="http" maxReceivedMessageSize="2097152">
          <readerQuotas maxStringContentLength="2097152" />
        </binding>
      </webHttpBinding>
      <wsHttpBinding>
        <binding name="https" maxReceivedMessageSize="524288">
          <security mode="Transport"/>
          <readerQuotas maxStringContentLength="128000" />
        </binding>
        <binding name="http" maxReceivedMessageSize="524288">
          <readerQuotas maxStringContentLength="128000" />
        </binding>
        <!-- 
            Configuration for invoking the Microsoft Online (BPOS) shell web service.
        -->
        <binding name="MsOnlineShellService_BindingConfiguration" maxReceivedMessageSize="102400">
          <security mode="Transport">
            <transport clientCredentialType="Certificate" />
          </security>
          <readerQuotas maxStringContentLength="102400" />
        </binding>
      </wsHttpBinding>
    </bindings>
    <client>
      <!-- 
            This section specifies the configuration for invoking the Microsoft Online (BPOS) shell web service.
            The "???" values are specified at deployment time, as implemented in:
            sources/dev/Management/src/Management/Deployment/Components/DatacenterClientAccessComponent.xml
        -->
      <endpoint name="MsOnlineShellService_EndPointConfiguration"
                address="???"
                binding="wsHttpBinding"
                bindingConfiguration="MsOnlineShellService_BindingConfiguration"
                contract="IShellService"
                behaviorConfiguration="MsOnlineShellService_EndPointBehavior">
                <identity>
                  <dns value="localhost"/>
                </identity>
      </endpoint>
    </client>
    <behaviors>
      <endpointBehaviors>
        <behavior name="MsOnlineShellService_EndPointBehavior">
          <clientCredentials>
            <serviceCertificate>
              <!-- Use the exchange server certificate in local server for authentication when connect 
              to Shell service. No point to check whether our certificate has been revocated. -->
              <authentication certificateValidationMode="ChainTrust" revocationMode="NoCheck"/> 
            </serviceCertificate>
          </clientCredentials>
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <diagnostics performanceCounters="ServiceOnly"/>
  </system.serviceModel>
  <!-- Allow everyone, including anonymous, to script resources -->
  <location path="WebResource.axd">
    <system.web>
      <authorization>
        <allow users="*"/>
        <allow users="?"/>
      </authorization>
    </system.web>
  </location>
  <location path="ping.ecp">
    <system.web>
      <authorization>
        <allow users="*"/>
        <allow users="?"/>
      </authorization>
    </system.web>
  </location>
  <location path="proxyLogon.ecp">
    <system.web>
      <authorization>
        <deny users="?"/>
        <allow users="*"/>
      </authorization>
    </system.web>
  </location>
  <!-- Used on FFO only -->
  <location path="TimeoutLogout.aspx">
    <system.web>
      <authorization>
        <allow users="*" />
        <allow users="?" />
      </authorization>
    </system.web>
  </location>
  <location path="Hybrid.aspx">
    <system.web>
      <authorization>
        <allow roles="HybridAdmin"/>
        <deny users="*"/>
        <deny users="?"/>
      </authorization>
    </system.web>
  </location>
  <location path="CrossPremise.aspx">
    <system.web>
      <authorization>
        <allow roles="HybridAdmin"/>
        <deny users="*"/>
        <deny users="?"/>
      </authorization>
    </system.web>
  </location>
  <location path="HybridLogoutHelper.aspx">
    <system.web>
      <authorization>
        <allow roles="Admin"/>
        <deny users="*"/>
        <deny users="?"/>
      </authorization>
    </system.web>
  </location>
  <location path="About.aspx">
    <system.web>
      <authorization>
        <allow roles="MyTeamMailboxes,MyBaseOptions,Admin"/>
        <deny users="*"/>
        <deny users="?"/>
      </authorization>
    </system.web>
  </location>
  <!-- TODO: Remove it when move reporting web service out of ecp. O15:2365177 -->
  <location path="ReportingWebService">
    <system.web>
      <httpRuntime encoderType="System.Web.Util.HttpEncoder"/>
    </system.web>
  </location>

  <csmsdk>
    <providers>
      <add name="FlightProvider" type="Microsoft.Exchange.Management.ControlPanel.EacFlightProvider, Microsoft.Exchange.Management.ControlPanel" />
    </providers>
  </csmsdk>
</configuration>
