Exchange Server 自訂設定保留

適用於:no-img-162016 yes-img-192019 yes-img-se訂閱版本

概觀

安裝 Exchange Server 之後,常見的系統管理工作是自訂設定,例如用戶端特定的郵件大小限制。 這些設定通常是在 、 sharedweb.config及 Exchange 伺服器的其他組態檔中web.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同時存在於 AND 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 模式

無人參與模式

保留的組態檔備份會儲存在子資料夾中 %ProgramFiles%\Microsoft\Exchange Server\V15\Config ,其命名格式 v_<ExchangeVersion>_<Timestamp>為 。

注意事項

如果在 [設定] 完成後不需要這些檔案,則可以安全地刪除這些檔案。

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

您可以執行下列 PowerShell 命令來建立機碼/值組:

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

如果在將註冊機碼設定為 1之後執行 Exchange 安裝程式,安裝程式將不會備份或還原任何設定中的任何機碼/值組。

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

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

無人參與模式

有人參與模式

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

  1. 讀取設定檔時發生例外狀況: <configFileName>。 略過保留。
  2. 儲存 <Preservation cmdlet name> 變更時遇到例外狀況: <configFileName>。
  3. 在設定檔的架構驗證期間遇到例外狀況: <configFileName>。 略過保留。
  4. <Preservation cmdlet name> 失敗原因: <configFileName>

系統管理員可以覆寫由安裝程式建立的檔案,以手動將任何組態檔案從備份位置複製到所需位置。 這也會將這些檔案還原為安裝前狀態。