Exchange Server自定义配置保留

概述

安装 Exchange Server 后,常见的管理任务是自定义设置,例如特定于客户端的消息大小限制。 这些设置通常在 、 和 Exchange 服务器上的其他配置文件中web.configsharedweb.config配置。

从历史上看,Exchange 服务器管理员面临的挑战之一是,每次安装累积更新 (CU) 时,安装程序都会覆盖这些文件及其中的自定义设置,迫使管理员备份/还原其设置,或者在每次安装 CU 后重新应用它们。

使用 Exchange Server 2019 CU13 及更高版本时,安装程序现在可以备份和还原最常见的配置文件,以便管理员不再需要手动还原或重新应用它们。

安装程序按以下方式保留自定义配置:

  1. 安装程序创建现有文件的备份。
  2. 安装程序安装Exchange Server (或升级现有Exchange Server) ,并使用 Exchange 安装程序中存在的默认配置和设置覆盖现有文件。
  3. 安装程序最终会还原从 Exchange 安装程序复制的新配置文件中存储在预升级配置文件中的相应文件和关键密钥的自定义值。

如果存在) ,安装程序会保留 (最关键的配置设置,这些设置可以包括整个部分或某些键值对。

  1. appSettings 包含许多用于配置应用程序设置范围的键值对, (例如日志记录路径、消息队列大小等 ) 。 如果存在此部分,则保留使用 <add key> 标记创建的任何键值对。

    例如,在以下文件中, ClientTunnelExpirationTime 将保留 。

    <configuration> 
    <appSettings> 
        <add key="ClientTunnelExpirationTime" value="30" /> 
    </appSettings> 
    </ configuration>
    
  2. 整个 proxySettings 部分至关重要,并会保留。

  3. maxAllowedContentLength 用于指定请求中) 内容 (的最大长度(以字节为单位)。

    <system.webServer> 
        <security> 
        <requestFiltering> 
            <requestLimits maxAllowedContentLength="4194304" /> 
        </requestFiltering> 
        </security> 
    <system.webServer> 
    
  4. maxRequestLength 用于指定最大请求大小。

    <system.web> 
        <httpRuntime maxRequestLength="4194304" /> 
    </system.web> 
    
  5. maxReceivedMessageSize在 和 custombinding 元素中使用 systembinding 来设置最大大小 ((以字节为单位),) 可以在配置此绑定的通道上接收的消息。

  6. maxStringContentLength存在于 和 customBinding 元素中systembinding,用于限制 XML 读取器返回的最大字符串大小。

  7. extendedProtectionPolicy 用于设置扩展保护策略,服务器使用该策略来验证传入的客户端连接。

  8. defaultProxy 用于配置 HTTP 代理服务器。

保留的配置文件以及保留的节和键的列表

下面是所有配置文件的列表,以及 CU 升级期间自动保留的部分和密钥。

注意

此功能不会保留在每站点/每个 vDir 级别上应用的 IIS URL 重写规则缓解措施,并且 Exchange 紧急缓解服务最终会重新应用(如果这些缓解措施仍适用于已安装的 CU)。 有关详细信息,可 在此处找到。

否。 配置文件名称 保留的节 其他密钥已保留
1 <ExchangeInstallPath>\V15\Bin\ComplianceAuditService.exe.config appSettings -
2 <ExchangeInstallPath>\V15\Bin\EdgeTransport.exe.config appSettings -
3 <ExchangeInstallPath>\V15\Bin\Microsoft.Exchange.Diagnostics.Service.exe.config appSettings -
4 <ExchangeInstallPath>\V15\Bin\Microsoft.Exchange.Directory.TopologyService.exe.config appSettings maxReceivedMessageSize,
maxStringContentLength
5 <ExchangeInstallPath>\V15\Bin\Microsoft.Exchange.EdgeSyncSvc.exe.config appSettings -
6 <ExchangeInstallPath>\V15\Bin\Microsoft.Exchange.Mitigation.Service.exe.config appSettings -
9 <ExchangeInstallPath>\V15\Bin\Microsoft.Exchange.RpcClientAccess.Service.exe.config appSettings,defaultProxy maxReceivedMessageSize,
maxStringContentLength
10 <ExchangeInstallPath>\V15\Bin\Microsoft.Exchange.Search.Service.exe.config appSettings -
12 <ExchangeInstallPath>\V15\Bin\Microsoft.Exchange.Servicehost.exe.config appSettings,defaultProxy maxReceivedMessageSize,
maxStringContentLength
14 <ExchangeInstallPath>\V15\Bin\Microsoft.Exchange.Store.Service.exe.config appSettings -
17 <ExchangeInstallPath>\V15\Bin\MSExchangeCompliance.exe.config appSettings -
18 <ExchangeInstallPath>\V15\Bin\MSExchangeDelivery.exe.config appSettings -
19 <ExchangeInstallPath>\V15\Bin\MSExchangeFrontEndTransport.exe.config appSettings -
20 <ExchangeInstallPath>\V15\Bin\MSExchangeHMHost.exe.config appSettings -
21 <ExchangeInstallPath>\V15\Bin\MSExchangeHMRecovery.exe.config appSettings -
22 <ExchangeInstallPath>\V15\Bin\MSExchangeHMWorker.exe.config appSettings -
23 <ExchangeInstallPath>\V15\Bin\MSExchangeMailboxAssistants.exe.config appSettings -
24 <ExchangeInstallPath>\V15\Bin\MsExchangeMailboxReplication.exe.config appSettings,defaultProxy maxReceivedMessageSize,
maxStringContentLength
26 <ExchangeInstallPath>\V15\Bin\MSExchangeSubmission.exe.config appSettings -
27 <ExchangeInstallPath>\V15\Bin\MSExchangeThrottling.exe.config appSettings -
28 <ExchangeInstallPath>\V15\Bin\MSExchangeTransport.exe.config appSettings -
29 <ExchangeInstallPath>\V15\ClientAccess\PopImap\Microsoft.Exchange.Imap4.exe.config appSettings、
defaultProxy
-
30 <ExchangeInstallPath>\V15\ClientAccess\PopImap\Microsoft.Exchange.Imap4Service.exe.config appSettings -
31 <ExchangeInstallPath>\V15\ClientAccess\PopImap\Microsoft.Exchange.Pop3.exe.config appSettings、
defaultProxy
-
32 <ExchangeInstallPath>\V15\ClientAccess\PopImap\Microsoft.Exchange.Pop3Service.exe.config appSettings -
33 <ExchangeInstallPath>\V15\FrontEnd\PopImap\Microsoft.Exchange.Imap4.exe.config appSettings、
defaultProxy
-
34 <ExchangeInstallPath>\V15\FrontEnd\PopImap\Microsoft.Exchange.Imap4Service.exe.config appSettings -
35 <ExchangeInstallPath>\V15\FrontEnd\PopImap\Microsoft.Exchange.Pop3.exe.config appSettings、
defaultProxy
-
36 <ExchangeInstallPath>\V15\FrontEnd\PopImap\Microsoft.Exchange.Pop3Service.exe.config appSettings -
37 <ExchangeInstallPath>\V15\Bin\Microsoft.Exchange.AddressBook.Service.dll.config appSettings -
38 <ExchangeInstallPath>\V15\Bin\Microsoft.Exchange.Management.Transport.dll.config appSettings -
39 <ExchangeInstallPath>\V15\TransportRoles\agents\Antimalware\Microsoft.Exchange.Transport.Agent.Malware.dll.config appSettings -
40 <ExchangeInstallPath>\V15\Bin\MSExchangeUM.config appSettings -
41 <ExchangeInstallPath>\V15\ClientAccess\Autodiscover\web.config appSettings maxReceivedMessageSize
42 <ExchangeInstallPath>\V15\ClientAccess\ecp\web.config appSettings maxReceivedMessageSize,
maxStringContentLength
43 <ExchangeInstallPath>\V15\ClientAccess\ecp\DLPPolicy\Web.config - maxRequestLength
44 <ExchangeInstallPath>\V15\ClientAccess\ecp\Handlers\Web.config - maxRequestLength
45 <ExchangeInstallPath>\V15\ClientAccess\ecp\PersonalSettings\Web.config - maxRequestLength
46 <ExchangeInstallPath>\V15\ClientAccess\ecp\UsersGroups\Web.config - maxRequestLength
47 <ExchangeInstallPath>\V15\ClientAccess\exchweb\ews\web.config appSettings、
defaultProxy,
extendedProtectionPolicy
maxAllowedContentLength、
maxReceivedMessageSize,
maxRequestLength、
maxStringContentLength
48 <ExchangeInstallPath>\V15\ClientAccess\mapi\emsmdb\web.config appSettings、
defaultProxy
maxAllowedContentLength、
maxReceivedMessageSize,
maxRequestLength、
maxStringContentLength
49 <ExchangeInstallPath>\V15\ClientAccess\mapi\nspi\web.config appSettings、
defaultProxy
maxAllowedContentLength、
maxRequestLength
50 <ExchangeInstallPath>\V15\ClientAccess\OAB\web.config appSettings -
52 <ExchangeInstallPath>\V15\ClientAccess\PowerShell\web.config appSettings -
53 <ExchangeInstallPath>\V15\ClientAccess\PowerShell-Proxy\web.config appSettings -
54 <ExchangeInstallPath>\V15\ClientAccess\PushNotifications\web.config appSettings maxReceivedMessageSize
55 <ExchangeInstallPath>\V15\ClientAccess\rest\web.config appSettings maxAllowedContentLength、
maxRequestLength
56 <ExchangeInstallPath>\V15\ClientAccess\RpcProxy\web.config appSettings -
57 <ExchangeInstallPath>\V15\ClientAccess\Sync\web.config appSettings、
defaultProxy
MaxDocumentDataSize、
maxRequestLength、
maxAllowedContentLength
58 <ExchangeInstallPath>\V15\FrontEnd\HttpProxy\autodiscover\web.config appSettings -
59 <ExchangeInstallPath>\V15\FrontEnd\HttpProxy\ecp\web.config appSettings maxAllowedContentLength、
maxRequestLength
60 <ExchangeInstallPath>\V15\FrontEnd\HttpProxy\ews\web.config appSettings maxAllowedContentLength、
maxRequestLength
61 <ExchangeInstallPath>\V15\FrontEnd\HttpProxy\mapi\web.config appSettings maxAllowedContentLength、
maxRequestLength
62 <ExchangeInstallPath>\V15\FrontEnd\HttpProxy\oab\web.config appSettings -
63 <ExchangeInstallPath>\V15\FrontEnd\HttpProxy\owa\web.config appSettings maxAllowedContentLength、
maxRequestLength
64 <ExchangeInstallPath>\V15\FrontEnd\HttpProxy\powershell\web.config appSettings -
65 <ExchangeInstallPath>\V15\FrontEnd\HttpProxy\pushnotifications\web.config appSettings maxAllowedContentLength、
maxRequestLength
66 <ExchangeInstallPath>\V15\FrontEnd\HttpProxy\ReportingWebService\web.config appSettings -
67 <ExchangeInstallPath>\V15\FrontEnd\HttpProxy\rest\web.config appSettings maxAllowedContentLength、
maxRequestLength
68 <ExchangeInstallPath>\V15\FrontEnd\HttpProxy\rpc\web.config appSettings maxAllowedContentLength、
maxRequestLength
69 <ExchangeInstallPath>\V15\FrontEnd\HttpProxy\sync\web.config appSettings maxRequestLength、
maxAllowedContentLength
70 <ExchangeInstallPath>\V15\FIP-FS\Data\Configuration.xml ProxySettings -
71 <ExchangeInstallPath>\V15\Bin\Search\Ceres\Runtime\1.0\Noderunner.exe.config - memoryLimitMegabytes

安装程序完成后,将显示以下消息,指示已成功还原所有保留的配置设置。

GUI 模式

GUI 模式下的 Exchange 设置显示设置已完成。

无人参与模式

无人参与模式下的 Exchange 设置显示设置已完成。

保留的配置文件的备份存储在 %ProgramFiles%\Microsoft\Exchange Server\V15\Config 使用 命名格式的 v_<ExchangeVersion>_<Timestamp>子文件夹中。

备份Exchange Server配置的屏幕截图。

注意

如果在安装程序完成后不需要这些文件,则可以安全地删除这些文件。

默认情况下,安装程序会保留自定义设置。 如果不想使用此功能,可以通过在 下HKLM\SOFTWARE\Microsoft\ExchangeServer\v15\Setup创建一个REG_SZ条目DisablePreservation并将值设置为 来1禁用此功能。

可以通过运行以下 PowerShell 命令来创建键/值对:

New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\ExchangeServer\v15\Setup -Name "DisablePreservation" -Value 1 -Type String

如果在将 regkey 设置为 1后运行 Exchange 安装程序,安装程序将不会备份或还原任何配置中的任何键/值对。

注册表项 注册表值 Exchange 设置行为
DisablePreservation (类型: REG_SZ) 1 配置文件中的所有键值对都会重置,并且不会存储预升级配置的备份, (此行为相当于以前的 CU 升级) 。
DisablePreservation (类型: REG_SZ) NULL 安装程序创建预升级配置备份,并将预升级配置中的某些键/值对保留到新配置。
DisablePreservation (类型: REG_SZ) 任何其他值 安装程序创建预升级配置备份,并将预升级配置中的某些键/值对保留到新配置。

如果安装程序无法将所有设置还原到其以前的状态,则会显示警告。

无人参与模式

无人参与模式下的 Exchange 设置显示设置已完成,但显示无法保留配置的警告。

参与模式

GUI 模式下的 Exchange 设置显示设置已完成,但显示无法保留配置的警告。

下一步,管理员可以分析安装程序日志文件,以查看哪些设置无法保留。 日志文件中可能存在一个或多个条目,用于指示哪些设置无法保留:

  1. 读取配置文件时遇到异常: <configFileName>。 跳过保留。
  2. 将更改保存到 <Preservation cmdlet name> 时遇到异常: <configFileName>
  3. 配置文件的架构验证期间遇到异常: <configFileName>。 跳过保留。
  4. <Preservation cmdlet name> 失败: <configFileName>

管理员可以通过覆盖安装程序创建的文件,手动将任何配置文件从备份位置复制到所需位置。 这也会将这些文件还原到其预安装状态。