Exchange Server自訂群組態保留

概觀

安裝Exchange Server之後,常見的系統管理工作是自訂設定,例如用戶端特定的訊息大小限制。 這些設定通常會在 web.configsharedweb.config 和 Exchange 伺服器上的其他組態檔中設定。

在過去,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 Proxy 伺服器。

保留的組態檔清單,以及保留的區段和金鑰

以下是所有組態檔的清單,以及 CU 升級期間自動保留的區段和金鑰。

注意事項

這項功能不會保留套用在每個月臺/每一 vDir 層級上的IIS URL 重寫規則防護功能,如果仍然適用于已安裝的 CU,最終會由 Exchange 緊急風險降低服務重新套用。 如需詳細資訊,請 參閱這裡

不能。 組態檔名稱 保留的區段 保留的其他金鑰
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組態的螢幕擷取畫面。

注意事項

如果安裝程式完成後不需要這些檔案,可以安全地刪除這些檔案。

安裝程式預設會保留自訂設定。 如果您不想要使用此功能,您可以在 下建立 REG_SZ 專案 DisablePreservation ,並將值設定為 1HKLM\SOFTWARE\Microsoft\ExchangeServer\v15\Setup 停用它。

您可以執行下列 PowerShell 命令來建立索引鍵/值組:

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

如果 Exchange 安裝程式是在將 regkey 設定為 1 之後執行,安裝程式將不會備份或還原任何組態中的任何索引鍵/值組。

登錄機碼 登錄值 Exchange 設定行為
DisablePreservation (類型: REG_SZ) 1 組態檔中的所有索引鍵值組都會重設,而且不會儲存預先升級組態的備份 (此行為相當於先前的 CU 升級) 。
DisablePreservation (類型: REG_SZ) NULL 安裝程式會建立 preupgrade 組態的備份,並將 preupgrade 設定中的特定索引鍵/值組保留到新的組態。
DisablePreservation (類型: REG_SZ) 任何其他值 安裝程式會建立 preupgrade 組態的備份,並將 preupgrade 設定中的特定索引鍵/值組保留到新的組態。

如果安裝程式無法將所有設定還原至先前的狀態,則會顯示警告。

自動模式

自動模式的 Exchange 安裝程式會顯示安裝程式已完成,但顯示無法保留設定的警告。

出席模式

GUI 模式中的 Exchange 安裝程式會顯示安裝程式已完成,但顯示無法保留設定的警告。

在下一個步驟中,系統管理員可以分析安裝程式記錄檔,以查看無法保留哪些設定。 記錄檔中可能會有一或多個專案,以指出無法保留哪些設定:

  1. 讀取組態檔時發生例外狀況: <configFileName> 。 略過保留。
  2. 將變更儲存 <Preservation cmdlet name> 至 時發生例外狀況: <configFileName>
  3. 組態檔的架構驗證期間發生例外狀況: <configFileName> 。 略過保留。
  4. <Preservation cmdlet name> 失敗: <configFileName>

系統管理員可以覆寫安裝程式所建立的檔案,手動將任何組態檔從備份位置複製到必要位置。 這也會將這些檔案還原至其預先設定狀態。