在 Exchange 安装程序中使用无人参与安装模式Use unattended mode in Exchange Setup

使用命令行运行 Exchange 安装程序,可以自动安装 Exchange,并能对 Exchange 服务器执行其他相关任务(例如,删除现有 Exchange 服务器或恢复发生故障的 Exchange 服务器)。Running Exchange Setup from the command line allows you to automate the installation of Exchange do and other related tasks on Exchange servers (for example, remove an existing Exchange server or recover a failed Exchange server).

本主题介绍了可用的命令行开关,并提供了相关示例。This topic describes the available command line switches, and provides examples.

若要详细了解如何计划 Exchange 2016 或 Exchange 2019,请参阅计划和部署 Exchange ServerFor more information about planning for Exchange 2016 or Exchange 2019, see Planning and deployment for Exchange Server.

若要了解要在安装后完成的任务,请参阅 Exchange Server 安装后任务For information about tasks to complete after installation, see Exchange Server post-installation tasks.

适用于无人参与安装模式的主要命令行开关Primary command line switches for unattended mode

下表介绍了适用于 Exchange 2016 或 Exchange 2019 中无人参与安装模式的主要(顶级的方案定义)命令行开关:The primary (top-level, scenario-defining) command line switches that are available in unattended Setup mode in Exchange 2016 or Exchange 2019 are described in the following table:

开关Switch 说明Description
/IAcceptExchangeServerLicenseTerms/IAcceptExchangeServerLicenseTerms (只要使用其他任何开关运行 Setup.exe)所有无人参与安装命令都必须使用此开关。如果不使用此开关,将会看到错误消息。若要阅读许可条款,请访问 Microsoft 许可条款This switch is required in all unattended setup commands (whenever you run Setup.exe with any additional switches). If you don't use this switch, you'll get an error. To read the license terms, visit Microsoft License Terms.
模式<InstallationMode>/Mode:<InstallationMode>
(或 _/m: <InstallationMode> _)(or /m:<InstallationMode>)
有效值为:Valid values are:
Install:使用 /Roles 开关指定的 Exchange 服务器角色,在新服务器上安装 Exchange。如果命令没有使用 /Mode 开关,此为默认值。Install: Installs Exchange on a new server using the Exchange server roles specified by the /Roles switch. This is the default value if the command doesn't use the /Mode switch.
Uninstall:从运行正常的服务器中卸载 Exchange。Uninstall: Uninstalls Exchange from a working server.
Upgrade:在 Exchange 服务器上安装累积更新 (CU)。Upgrade: Installs a Cumulative Update (CU) on an Exchange server.
RecoverServer:在服务器上发生灾难性硬件或软件故障后,使用 Active Directory 中的现有 Exchange 服务器对象恢复 Exchange 服务器。有关说明,请参阅恢复 Exchange 服务器RecoverServer: Recovers an Exchange server using the existing Exchange server object in Active Directory after a catastrophic hardware or software failure on the server. For instructions, see Recover Exchange servers.
角色<ServerRole>/Roles:<ServerRole>
(或 _/Role: <ServerRole> _或 _/r: <ServerRole> _)(or /Role:<ServerRole> or /r:<ServerRole>)
/Mode:Install 命令必须使用此开关。有效值为:This switch is required in /Mode:Install commands. Valid values are:
Mailbox(或 mb):在本地服务器上安装邮箱服务器角色和 Exchange 管理工具。此为默认值。不得将此值与 EdgeTransport 结合使用。Mailbox (or mb): Installs the Mailbox server role and the Exchange management tools on the local server. This is the default value. You can't use this value with EdgeTransport.
EdgeTransport(或 et):在本地服务器上安装边缘传输服务器角色和 Exchange 管理工具。不得将此值与 Mailbox 结合使用。EdgeTransport (or et): Installs the Edge Transport server role and the Exchange management tools on the local server. You can't use this value with Mailbox.
ManagementTools(mt 或 t):在未运行 Exchange 的客户端或其他 Windows 服务器上安装 Exchange 管理工具。ManagementTools (or mt or t): Installs the Exchange management tools on clients or other Windows servers that aren't running Exchange.
/PrepareAD(或 /p/PrepareAD (or /p)
/PrepareSchema(或 /ps/PrepareSchema (or /ps)
/PrepareDomain: <DomainFQDN> (或 /pd: <DomainFQDN> /PrepareDomain:<DomainFQDN> (or /pd:<DomainFQDN>)
/PrepareAllDomains(或 /pad/PrepareAllDomains (or /pad)
这些开关可用于为 Exchange 扩展 Active Directory 架构,为 Exchange 准备 Active Directory,并为 Exchange 准备部分或全部 Active Directory 域。有关详细信息,请参阅为 Exchange 准备 Active Directory 和域Use these switches to extend the Active Directory schema for Exchange, prepare Active Directory for Exchange, and prepare some or all Active Directory domains for Exchange. For more information, see Prepare Active Directory and domains for Exchange
/NewProvisionedServer [: <ServerName> ] (或 /nprs [: <ServerName> ]/NewProvisionedServer[:<ServerName>] (or /nprs[:<ServerName>]
_/RemoveProvisionedServer: <ServerName> _(或 /rprs: <ServerName> /RemoveProvisionedServer:<ServerName> (or /rprs:<ServerName>)
/NewProvisionedServer 开关用于在 Active Directory 中创建 Exchange 服务器对象。完成上述操作之后,“委派的安装程序”角色组的成员可以在服务器上安装 Exchange。有关详细信息,请参阅委派安装 Exchange 服务器The /NewProvisionedServer switch creates the Exchange server object in Active Directory. After that, a member of the Delegated Setup role group can install Exchange on the server. For more information, see Delegate the installation of Exchange servers.

/RemoveProvisionedServer 开关用于在服务器上安装 Exchange 之前,从 Active Directory 中删除预配的 Exchange 服务器对象。The /RemoveProvisionedServer switch removes a provisioned Exchange server object from Active Directory before Exchange is installed on the server.
/AddUmLanguagePack: <Culture1> , <Culture2> .。。<CultureN>/AddUmLanguagePack:<Culture1>,<Culture2>...<CultureN>
/RemoveUmLanguagePack: <Culture1> , <Culture2> .。。<CultureN>/RemoveUmLanguagePack:<Culture1>,<Culture2>...<CultureN>
注意:这些开关不适用于 Exchange 2019,仅适用于 Exchange 2016。Note: These switches aren't available in Exchange 2019. They're only available in Exchange 2016.

这些开关可用于在现有 Exchange 2016 邮箱服务器中添加或删除统一消息 (UM) 语言包。借助 UM 语言包,呼叫方和 Outlook Voice Access 用户可以用这些语言与 UM 系统进行交互。无法添加或删除 en-US 语言包。Adds or removes Unified Messaging (UM) language packs from existing Exchange 2016 Mailbox servers. UM language packs enable callers and Outlook Voice Access users to interact with the UM system in those languages. You can't add or remove the en-US language pack.
您可以通过使用 _/AddUmLanguagePack_开关或通过运行 UMLanguagePack 在现有邮箱服务器上安装语言包。 <Culture> 。exe 文件。您只能使用 _/RemoveUmLanguagePack_开关删除已安装的语言包。有关详细信息,请参阅UM 语言、提示和问候语You can install language packs on existing Mailbox servers by using the /AddUmLanguagePack switch or by running the UMLanguagePack.<Culture>.exe file directly. You can only remove installed language packs by using the /RemoveUmLanguagePack switch. For more information, see UM languages, prompts, and greetings.

适用于无人参与安装模式的可选命令行开关Optional command line switches for unattended mode

下表介绍了适用于 Exchange 2016 或 Exchange 2019 中无人参与安装模式的可选(支持)命令行开关:The optional (supporting) command line switches that are available in unattended Setup mode in Exchange 2016 or Exchange 2019 are described in the following table:

开关Switch 有效值Valid values 默认值Default value **可配合使用的命令**Available with 说明**Description**
/ActiveDirectorySplitPermissions:<TrueOrFalse>/ActiveDirectorySplitPermissions:<TrueOrFalse> True 或 FalseTrue or False FalseFalse /Mode:Install /Roles:Mailbox/PrepareAD 命令,用于组织中的首台 Exchange 服务器。/Mode:Install /Roles:Mailbox or /PrepareAD commands for the first Exchange server in the organization. 此开关用于在准备 Active Directory 时,指定 Active Directory 拆分权限模型。有关详细信息,请参阅了解拆分权限中的“Active Directory 拆分权限”部分。Specifies the Active Directory split permissions model when preparing Active Directory. For more information, see the "Active Directory split permissions" section in Understanding split permissions.
/AdamLdapPort:<TCPPortNumber>/AdamLdapPort:<TCPPortNumber> 有效的 TCP 端口号A valid TCP port number 5038950389 /Mode:Install /Roles:EdgeTransport 命令/Mode:Install /Roles:EdgeTransport commands 此开关用于指定,要对边缘传输服务器上的 Active Directory 轻型目录服务 (AD LDS) 实例使用的自定义 LDAP 端口。此值存储在注册表中的 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExchangeServer\v15\EdgeTransportRole\AdamSettings\MSExchange\LdapPort 处。Specifies a custom LDAP port to use for the Active Directory Lightweight Directory Services (AD LDS) instance on Edge Transport servers. The value is stored in the registry at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExchangeServer\v15\EdgeTransportRole\AdamSettings\MSExchange\LdapPort.
/AdamSslPort:<TCPPortNumber>/AdamSslPort:<TCPPortNumber> 有效的 TCP 端口号A valid TCP port number 5063650636 /Mode:Install /Roles:EdgeTransport 命令/Mode:Install /Roles:EdgeTransport commands 此开关用于指定,要对边缘传输服务器上的 AD LDS 实例使用的自定义 SSL (TLS) 端口。此值存储在注册表中的 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExchangeServer\v15\EdgeTransportRole\AdamSettings\MSExchange\SslPort 处。Specifies a custom SSL (TLS) port to use for the AD LDS instance on Edge Transport servers. The value is stored in the registry at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ExchangeServer\v15\EdgeTransportRole\AdamSettings\MSExchange\SslPort.
/AnswerFile: " <PathAndFileName> "/AnswerFile:"<PathAndFileName>"
(或_af: " <PathAndFileName> "_)(or af:"<PathAndFileName>")
文本文件的名称和位置(例如,“D:\Server data\answer.txt”)。The name and location of a text file (for example,"D:\Server data\answer.txt"). n/a /Mode:Install /Roles:Mailbox/Mode:Install /Roles:EdgeTransport 命令/Mode:Install /Roles:Mailbox or /Mode:Install /Roles:EdgeTransport commands 此开关用于创建具有以下用途的文本文件:在多台计算机上安装 Exchange(设置相同)。可以在答案文件中使用以下开关:AdamLdapPortAdamSslPortCustomerFeedbackEnabledDbFilePathDisableAMFilteringDoNotStartTransportEnableErrorReportingIAcceptExchangeServerLicenseTermsLogFolderPathMdbnameOrganizationNameTenantOrganizationConfigUpdatesDir。请勿将正斜杠字符 (/) 与答案文件中的这些开关一起使用。每个开关或开关/值对在文件中都单独占据一行。Use this switch to create a text file that you can use to install Exchange on multiple computers with the same settings. You can use the following switches in the answer file: AdamLdapPort, AdamSslPort, CustomerFeedbackEnabled, DbFilePath, DisableAMFiltering, DoNotStartTransport, EnableErrorReporting, IAcceptExchangeServerLicenseTerms, LogFolderPath, Mdbname, OrganizationName, TenantOrganizationConfig, and UpdatesDir. Don't use the forward slash character ( / ) with the switches in the answer file. Put each switch or switch/value pair on one line in the file.
CustomerFeedbackEnabled<TrueOrFalse>/CustomerFeedbackEnabled:<TrueOrFalse> True 或 FalseTrue or False FalseFalse /Mode:Install/PrepareAD 命令/Mode:Install and /PrepareAD commands 指定是否允许 Exchange 向 Microsoft 提供使用反馈,以帮助改进今后推出的 Exchange 功能。可以在安装程序完成后对 Set-ExchangeServer cmdlet 使用 ErrorReportingEnabled 参数,对服务器启用或禁用错误报告。Specifies whether to allow or prevent Exchange from providing usage feedback to Microsoft to help improve future Exchange features. You can enable or disable error reporting on the server after setup is complete by using the ErrorReportingEnabled parameter on the Set-ExchangeServer cmdlet.
/DbFilePath: " <Path> \ <FileName> .edb"/DbFilePath:"<Path>\<FileName>.edb" 文件夹路径和 .edb 文件名(例如,“D:\Exchange Database Files\DB01\db01.edb”)。A folder path and an .edb filename (for example, "D:\Exchange Database Files\DB01\db01.edb"). %ExchangeInstallPath%Mailbox\<DatabaseName>\<DatabaseName>.edb,其中:%ExchangeInstallPath%Mailbox\<DatabaseName>\<DatabaseName>.edb where:
• <DatabaseName> 是与数据库的默认名称使用 _/MdbName_开关(不带 .edb 文件扩展名)指定的值匹配的**邮箱数据库 <10DigitNumber> ** 。• <DatabaseName> is Mailbox Database <10DigitNumber> that matches the default name of the database or the value you specified with the /MdbName switch (without the .edb file name extension).
• %ExchangeInstallPath% 是 %ProgramFiles%\Microsoft\Exchange Server\V15\,或使用 /TargetDir 开关指定的位置。• %ExchangeInstallPath% is %ProgramFiles%\Microsoft\Exchange Server\V15\ or the location you specified with the /TargetDir switch.
/Mode:Install /Roles:Mailbox 命令/Mode:Install /Roles:Mailbox commands 此开关用于指定,在新邮箱服务器上创建的首个邮箱数据库的位置。可使用 /MdbName 开关指定数据库文件名,并使用 /LogFolderPath 开关指定数据库事务日志文件的位置。Specifies the location of the first mailbox database that's created on the new Mailbox server. You can specify the name of the database file with the /MdbName switch and the location of the database transaction log files with the /LogFolderPath switch.
/DisableAMFiltering/DisableAMFiltering n/a n/a /Mode:Install /Roles:Mailbox 命令/Mode:Install /Roles:Mailbox commands 此开关用于对邮箱服务器禁用内置的 Exchange 反恶意软件筛选。若要详细了解反恶意软件筛选,请参阅 Exchange Server 中的反恶意软件保护Disables the built-in Exchange antimalware filtering on Mailbox servers. For more information about antimalware filtering, see Antimalware protection in Exchange Server.
控制器<ServerNameOrFQDN>/DomainController:<ServerNameOrFQDN>
(或 _/dc: <ServerNameOrFQDN> _)(or /dc:<ServerNameOrFQDN>)
服务器名称(例如,DC01)或域控制器的 FQDN(例如,dc01.contoso.com)。The server name (for example, DC01) or FQDN (for example, dc01.contoso.com) of the domain controller. 与正在运行安装程序的目标服务器位于同一 Active Directory 站点中的随机选择的域控制器。A randomly-selected domain controller in the same Active Directory site as the target server where you're running Setup. 所有 /Mode 命令(安装边缘传输服务器时除外),或 /PrepareAD/PrepareSchema/PrepareDomain/PrepareAllDomains 命令All /Mode commands (except when you're installing an Edge Transport server) or /PrepareAD, /PrepareSchema, /PrepareDomain and /PrepareAllDomains commands 此开关用于指定,Exchange 安装程序用来对 Active Directory 执行读取和写入操作的域控制器。域控制器必须满足 Exchange 2016Exchange 2019 最低要求。Specifies the domain controller that Exchange Setup uses to read from and write to Active Directory. The domain controller must meet the minimum requirements for Exchange 2016 or Exchange 2019.

如果在为 Exchange 扩展 Active Directory 架构的 /PrepareSchema/PrepareAD 命令中使用此开关,必须指定架构主机;否则,将会看到错误消息。If you use this switch in /PrepareSchema or /PrepareAD commands that extend the Active Directory schema for Exchange, you must specify the schema master; otherwise, you'll get an error.
/DoNotStartTransport/DoNotStartTransport n/a n/a /Mode:Install /Roles:Mailbox/Mode:Install /Roles:EdgeTransport/Mode:RecoverServer 命令。/Mode:Install /Roles:Mailbox, /Mode:Install /Roles:EdgeTransport, and /Mode:RecoverServer commands. 此开关用于指示安装程序,在安装程序完成后,不要在邮箱服务器或边缘传输服务器上启动 Microsoft Exchange 传输服务(邮件流)。可使用此开关配置在服务器接受电子邮件前的其他设置(例如,配置反垃圾邮件代理,或将队列数据库移回已恢复 Exchange 服务器)。Tells Setup to not start the Microsoft Exchange Transport service (mail flow) on Mailbox servers or Edge Transport servers after Setup is complete. You can use this switch to configure additional settings before the server accepts email messages (for example, configure antispam agents or move the queue database back onto a recovered Exchange server.)
/EnableErrorReporting/EnableErrorReporting n/a DisabledDisabled /Mode:Install/Mode:Upgrade/Mode:RecoverServer 命令/Mode:Install, /Mode:Upgrade, and /Mode:RecoverServer commands 此开关用于指定,是允许还是阻止 Exchange 自动联机检查是否有可解决所遇错误的解决方案。可以对 Set-ExchangeServer cmdlet 使用 ErrorReportingEnabled 参数,在安装程序完成后对服务器启用或禁用错误报告。Specifies whether to allow Exchange to automatically check online for solutions to errors that it encounters. You can enable or disable error reporting on the server after setup is complete by using the ErrorReportingEnabled parameter on the Set-ExchangeServer cmdlet.
/InstallWindowsComponents/InstallWindowsComponents n/a n/a /Mode:Install 命令/Mode:Install commands 此开关用于为指定的 Exchange 服务器角色安装所需的 Windows 角色和功能。如果需要重新启动,安装程序会在安装结束时继续运行。Installs the required Windows roles and features for the specified Exchange server role. If a reboot is required, Setup will resume where the installation ended.
/LogFolderPath: " <Path> "/LogFolderPath:"<Path>" 文件夹路径(例如,“E:\Exchange Database Logs”)。A folder path (for example, "E:\Exchange Database Logs"). %ExchangeInstallPath%Mailbox\<DatabaseName>,其中:%ExchangeInstallPath%Mailbox\<DatabaseName> where:
• <DatabaseName> 是与数据库的默认名称使用 _/MdbName_开关(不带 .edb 文件扩展名)指定的值匹配的**邮箱数据库 <10DigitNumber> ** 。• <DatabaseName> is Mailbox Database <10DigitNumber> that matches the default name of the database or the value you specified with the /MdbName switch (without the .edb file name extension).
• %ExchangeInstallPath% 是 %ProgramFiles%\Microsoft\Exchange Server\V15\,或使用 /TargetDir 开关指定的位置。• %ExchangeInstallPath% is %ProgramFiles%\Microsoft\Exchange Server\V15\ or the location you specified with the /TargetDir switch.
/Mode:Install /Roles:Mailbox 命令/Mode:Install /Roles:Mailbox commands 此开关用于指定,在新邮箱服务器上创建的首个邮箱数据库的事务日志文件位置。可使用 /DbFilePath 开关指定数据库文件的位置。Specifies the location of the transaction log files for the first mailbox database that's created on the new Mailbox server. You can specify the location of the database files with the /DbFilePath switch.
/MdbName: " <FileName> "/MdbName:"<FileName>" 没有 .edb 扩展名的数据库文件名(例如,“db01”)A database filename without the .edb extension (for example, "db01") **邮箱数据库 <10DigitNumber> **(例如,邮箱数据库 0139595516)。Mailbox Database <10DigitNumber> (for example, Mailbox Database 0139595516). /Mode:Install /Roles:Mailbox 命令/Mode:Install /Roles:Mailbox commands 此开关用于指定,在新邮箱服务器上创建的首个邮箱数据库的名称。可使用 /DbFilePath 开关指定数据库文件的位置。Specifies the name of the first mailbox database that's created on the new Mailbox server. You can specify the location of the database files with the /DbFilePath switch.
/OrganizationName: " <Organization Name> "/OrganizationName:"<Organization Name>"
(或 /on: " <Organization Name> "(or /on:"<Organization Name>")
文本字符串(例如,“Contoso Corporation”)。A text string (for example, "Contoso Corporation"). 在命令行安装程序中为空白;在 Exchange 安装向导中为首个组织Blank in command line setup; First Organization in the Exchange Setup wizard. /Mode:Install /Roles:Mailbox/PrepareAD 命令,用于组织中的首台 Exchange 服务器。/Mode:Install /Roles:Mailbox or /PrepareAD commands for the first Exchange server in the organization. 组织名称由 Exchange 在内部使用,通常对用户不可见,既不会影响 Exchange 的功能,也不会确定可使用的电子邮件地址。The organization name is used internally by Exchange, isn't typically seen by users, doesn't affect the functionality of Exchange, and doesn't determine what you can use for email addresses.
• 组织名称的字符数上限为 64 个,且不得为空白。• The organization name can't contain more than 64 characters, and can't be blank.
• 有效字符为 A 到 Z、a 到 z、0 到 9、连字符或破折号 (-) 和空格,但不得使用前导或尾随空格。• Valid characters are A to Z, a to z, 0 to 9, hyphen or dash (-), and space, but leading or trailing spaces aren't allowed.
• 一旦设置,便无法再更改组织名称。• You can't change the organization name after it's set.
/SourceDir: " <Path> "/SourceDir:"<Path>"
(或 /s: " <Path> "(or /s:"<Path>")
文件夹路径(例如,“Z:\Exchange”)。A folder path (for example, "Z:\Exchange). Exchange 安装介质上的 ServerRoles\UnifiedMessaging 文件夹。The ServerRoles\UnifiedMessaging folder on the Exchange installation media. Exchange 2016 中的 /AddUmLanguagePack 命令(不适用于 Exchange 2019)/AddUmLanguagePack commands in Exchange 2016 (not available in Exchange 2019) 指定语言包(UMLanguagePack)的 <Culture> 位置。exe 文件),以在现有的 Exchange 2016 邮箱服务器上安装。Specifies the location of the language packs (UMLanguagePack.<Culture>.exe files) to install on existing Exchange 2016 Mailbox servers.
/TargetDir: " <Path> "/TargetDir:"<Path>"
(或 /t: " <Path> "(or /t:"<Path>")
文件夹路径(例如,“D:\Program Files\Microsoft\Exchange”)。A folder path (for example, "D:\Program Files\Microsoft\Exchange"). %ProgramFiles%\Microsoft\Exchange Server\V15\%ProgramFiles%\Microsoft\Exchange Server\V15\ /Mode:Install/Mode:RecoverServer 命令/Mode:Install and /Mode:RecoverServer commands 此开关用于指定,在服务器上安装 Exchange 的位置。不得在驱动器的根目录(例如,C:\)中安装 Exchange,也不得在 ROM 驱动器、RAM 磁盘、网络驱动器、可移动磁盘或未知类型驱动器上安装 Exchange。Specifies where to install Exchange on the server. You can't install Exchange in the root of a drive (for example, C:\), or on a ROM drive, RAM disk, network drive, removable disk, or unknown drive type.
恢复使用自定义安装路径安装的故障 Exchange 服务器时,需要在恢复期间使用此开关指定自定义路径。When you recover a failed Exchange server that was installed using a custom installation path, you need to use this switch to specify the custom path during the recovery.
/TenantOrganizationConfig: " <Path> "/TenantOrganizationConfig:"<Path>" 文件夹路径(例如,“C:\Data”)。A folder path (for example "C:\Data") n/a /Mode:Install/PrepareAD 命令。/Mode:Install or /PrepareAD commands. 在本地组织与 Microsoft 365 或 Office 365 之间的混合部署中,需要指定包含 Microsoft 365 或 Office 365 组织的配置信息的文本文件的位置。您可以通过在 Microsoft 365 或 Office 365 组织中的 Exchange Online PowerShell 中运行set-organizationconfig cmdlet 来创建此文件。Required in hybrid deployments between on-premises organizations and Microsoft 365 or Office 365 to specify the location of the text file that contains the configuration information for your Microsoft 365 or Office 365 organization. You create this file by running the Get-OrganizationConfig cmdlet in Exchange Online PowerShell in your Microsoft 365 or Office 365 organization.
/UpdatesDir: " <Path> "/UpdatesDir:"<Path>"
(或 /u: " <Path> "(or /u:"<Path>")
文件夹路径(例如,“D:\Downloads\Exchange Updates”)。A folder path (for example, "D:\Downloads\Exchange Updates"). Exchange 安装介质的根目录下的 Updates 文件夹。The Updates folder at the root of the Exchange installation media. /Mode:Install/Mode:Upgrade/Mode:RecoverServer/AddUmLanguagePack 命令。/Mode:Install, /Mode:Upgrade, /Mode:RecoverServer, and /AddUmLanguagePack commands. 此开关用于指定,安装程序要安装的更新的源位置。只能为更新指定一个文件夹。Specifies the source location of updates for Setup to install. You can only specify one folder for updates.

此文件夹中的任何 UM 语言包都会自动安装在目标 Exchange 2016 邮箱服务器上。Any UM language packs located in this folder will be automatically installed on the target Exchange 2016 Mailbox server.

开始前,有必要了解什么?What do you need to know before you begin?

  • 在目标计算机上下载最新版 Exchange。有关详细信息,请参阅 Exchange Server 更新Download the latest version of Exchange on the target computer. For more information, see Updates for Exchange Server.

  • 确认是否满足 Exchange Server 系统要求Exchange Server 系统必备中的网络、计算机硬件、操作系统和软件要求。Verify the network, computer hardware, operating system, and software requirements at: Exchange Server system requirements and Exchange Server prerequisites.

  • 确认是否已阅读 Exchange Server 发行说明中的发行说明。Verify that you've read the release notes at Release notes for Exchange Server.

    注意

    在服务器上安装 Exchange 之后,不得更改服务器名称。不支持在安装了 Exchange 服务器角色之后重命名服务器。After you install Exchange on a server, you must not change the server name. Renaming a server after you've installed an Exchange server role is not supported.

  • 对于邮箱服务器:For Mailbox servers:

    • 估计完成时间:60 分钟Estimated time to complete: 60 minutes

    • 目标服务器必须是 Active Directory 域的成员。The target server must be a member of an Active Directory domain.

    • 用于安装 Exchange 的帐户必须拥有以下权限*The account that you use to install Exchange requires the following permissions:*:

      • 企业管理员组成员身份:如果这是组织中的首台 Exchange 服务器,帐户必须拥有此权限。Enterprise Admins group membership: Required if this is the first Exchange server in the organization.

      • 架构管理员组成员身份:如果以前尚未为 Exchange 扩展过 Active Directory 架构准备过 Active Directory,必须拥有此权限。Schema Admins group membership: Required if you haven't previously extended the Active Directory schema or prepared Active Directory for Exchange.

      • Exchange 组织管理角色组成员身份:如果已准备 Active Directory 域(包含 Exchange 服务器),或如果组织中已有其他 Exchange 服务器,必须拥有此权限。Exchange Organization Management role group membership: Required if you've already prepared the Active Directory domain that will contain the Exchange server, or if other Exchange servers already exist in the organization.

      *“委派的安装程序”**** 角色组的成员可以在服务器上安装 Exchange,这些服务器已在 Active Directory 中由 Exchange 管理员预配。有关详细信息,请参阅委派安装 Exchange 服务器* Members of the Delegated Setup role group can install Exchange on servers that have already been provisioned in Active Directory by an Exchange administrator. For more information, see Delegate the installation of Exchange servers.

  • 对于边缘传输服务器:For Edge Transport servers:

    • 估计完成时间:40 分钟Estimated time to complete: 40 minutes

    • 建议在组织内部 Active Directory 林之外的外围网络中安装边缘传输服务器。在域加入计算机上安装边缘传输服务器角色,只能启用 Windows 功能和设置的域管理。边缘传输服务器不直接访问 Active Directory,而是使用 Active Directory 轻型目录服务 (AD LDS) 存储配置和收件人信息。若要详细了解边缘传输角色,请参阅边缘传输服务器We recommend that you install Edge Transport servers in a perimeter network that's outside of your organization's internal Active Directory forest. Installing the Edge Transport server role on domain-joined computers only enables domain management of Windows features and settings. Edge Transport servers don't directly access Active Directory. Instead, they use Active Directory Lightweight Directory Services (AD LDS) to store configuration and recipient information. For more information about the Edge Transport role, see Edge Transport servers.

    • 确认目标计算机上的本地帐户是否是目标服务器上本地管理员组的成员。Verify the local account on the target computer is a member of the local Administrators group on the target server.

    • 您需要在计算机上配置主 DNS 后缀。例如,如果您的计算机的完全限定域名为 edge.contoso.com,计算机的 DNS 后缀是 contoso.com。有关详细信息,请参阅缺少主要的 DNS 后缀 [ms.exch.setupreadiness.FqdnMissing]You need to configure the primary DNS suffix on the computer. For example, if the fully qualified domain name of your computer is edge.contoso.com, the DNS suffix for the computer is contoso.com. For more information, see Primary DNS Suffix is missing [ms.exch.setupreadiness.FqdnMissing].

    • 在共存方案中,必须先更新 Exchange 2010 集线器传输服务器,然后才能将 Exchange 2016 边缘传输服务器订阅到包含 Exchange 2010 集线器传输服务器的 Active Directory 站点。如果不安装此更新,EdgeSync 订阅便无法正常用于参与 EdgeSync 同步的 Exchange 2010 集线器传输服务器。有关详细信息,请参阅 Exchange 2016 支持的共存方案In coexistence scenarios, Exchange 2010 Hub Transport servers need an update before you can subscribe a Exchange 2016 Edge Transport server to an Active Directory site that contains Exchange 2010 Hub Transport servers. If you don't install this update, the EdgeSync Subscription won't work correctly for Exchange 2010 Hub Transport server that participate in EdgeSync synchronization. For more information, see Supported coexistence scenarios for Exchange 2016.

  • 若要了解本主题中的过程可能适用的键盘快捷键,请参阅 Exchange 管理中心内的键盘快捷键For information about keyboard shortcuts that may apply to the procedures in this topic, see Keyboard shortcuts in the Exchange admin center.

在无人参与安装模式下使用 Setup.exe 安装 ExchangeUse Setup.exe to install Exchange in unattended mode

  1. 在目标服务器上,打开“文件资源管理器”,右键单击已下载的 Exchange ISO 映像文件,再选择“装载”****。请注意分配的虚拟 DVD 驱动器号。On the target server, open File Explorer, right-click on the Exchange ISO image file that you downloaded, and then select Mount. Note the virtual DVD drive letter that's assigned.

  2. 打开 Windows 命令提示符窗口。例如:Open a Windows Command Prompt window. For example:

    • 同时按 Windows 键和 R 键打开“运行”**** 对话框,键入“cmd.exe”,然后按“确定”****。Press the Windows key + 'R' to open the Run dialog, type cmd.exe, and then press OK.

    • 按“启动”****。在“搜索”**** 框中,键入“命令提示符”****,再选择结果列表中的“命令提示符”****。Press Start. In the Search box, type Command Prompt, then in the list of results, select Command Prompt.

  3. 在“命令提示符”窗口中,使用以下语法:In the Command Prompt window, use the following syntax:

    <Virtual DVD drive letter>:\Setup.exe /IAcceptExchangeServerLicenseTerms [Switches]
    

    安装程序将安装程序文件复制到本地计算机。Setup copies the setup files to the local computer.

    安装程序检查是否满足先决条件,包括要安装的服务器角色专属的所有先决条件。如果尚未满足所有先决条件,安装程序会失败,并返回说明失败原因的错误消息。如果已满足所有先决条件,安装程序便会安装 Exchange。Setup checks the prerequisites, including all prerequisites specific to the server roles that you're installing. If you haven't met all the prerequisites, Setup fails and returns an error message that explains the reason for the failure. If you've met all the prerequisites, Setup installs Exchange.

  4. 在 Exchange 安装完成后,重启服务器。Restart the server after the Exchange installation is complete.

  5. 通过执行 Exchange Server 安装后任务中介绍的任务来完成部署。Complete your deployment by performing the tasks provided in Exchange Server post-installation tasks.

无人参与安装模式示例Unattended mode examples

在无人参与安装模式下为 Exchange 准备 Active DirectoryPrepare Active Directory for Exchange in unattended mode

下面的示例将“Fabrikam Ltd”配置为 Active Directory 中的 Exchange 组织名称,并为要安装的 Exchange 版本准备 Active Directory。This example configures "Fabrikam Ltd" as the Exchange organization name in Active Directory and prepares Active Directory for the version of Exchange that's being installed.

Setup.exe /IAcceptExchangeServerLicenseTerms /PrepareAD /OrganizationName:"Fabrikam Ltd"

有关详细信息,请参阅为 Exchange 准备 Active Directory 和域For more information, see Prepare Active Directory and domains for Exchange.

在无人参与安装模式下安装邮箱服务器Install Mailbox servers in unattended mode

  • 下面的示例在组织中安装首台 Exchange 服务器(邮箱服务器),将“Contoso Corporation”配置为 Active Directory 中的 Exchange 组织名称,并在本地服务器上安装 Exchange 管理工具。This example installs the first Exchange server (Mailbox server) in the organization, configures "Contoso Corporation" as the Exchange organization name in Active Directory, and installs the Exchange management tools on the local server.

    Setup.exe /IAcceptExchangeServerLicenseTerms /Mode:Install /Roles:Mailbox /on:"Contoso Corporation"
    
  • 下面的示例在已为要安装的 Exchange 版本准备 Active Directory 的组织中,在本地服务器上的默认文件夹中安装邮箱服务器角色和管理工具。This example installs the Mailbox server role and the management tools in the default folder on the local server in an organization where Active Directory has already been prepared for the version of Exchange that's being installed.

    Setup.exe /IAcceptExchangeServerLicenseTerms /mode:Install /r:MB
    
  • 下面的示例在本地服务器上的“C:\Exchange Server”文件夹中安装邮箱服务器角色和管理工具。This example installs the Mailbox server role and the management tools in the "C:\Exchange Server" folder on the local server.

    Setup.exe /IAcceptExchangeServerLicenseTerms /Mode:Install /Role:Mailbox /TargetDir:"C:\Exchange Server"
    
  • 下面的示例使用 ExchangeConfig.txt 文件中的设置,在本地服务器上安装邮箱服务器角色。This example installs the Mailbox server role on the local server by using the settings in the ExchangeConfig.txt file.

    Setup.exe /IAcceptExchangeServerLicenseTerms /mode:Install /role:Mailbox /AnswerFile:c:\ExchangeConfig.txt
    
  • 下面的示例使用 DC01 域控制器对 Active Directory 执行读取和写入操作,同时在本地服务器上安装邮箱服务器角色和管理工具。This example uses the domain controller named DC01 to read from and write to Active Directory while installing the Mailbox server role and the management tools on the local server.

    Setup.exe /IAcceptExchangeServerLicenseTerms /mode:Install /role:Mailbox /DomainController:DC01
    
  • 下面的示例使用指定文件夹中的修补程序更新 Exchange 安装程序,然后在本地服务器上安装邮箱服务器角色和管理工具。仅在 Exchange 2016 中,才会自动安装此文件夹中的任何 UM 语言包。This example updates Exchange Setup with patches from the specified folder, and then installs the Mailbox server role and the management tools on the local server. In Exchange 2016 only, if any UM language packs are located in this folder, the language packs are automatically installed.

    Setup.exe /IAcceptExchangeServerLicenseTerms /role:Mailbox /UpdatesDir:"C:\ExchangeServer\New Patches"
    

在无人参与安装模式下安装边缘传输服务器Install Edge Transport servers in unattended mode

  • 下面的示例在本地服务器中的默认位置上安装边缘传输服务器角色和管理工具。This example installs the Edge Transport server role and the management tools in the default location on the local server.

    Setup.exe /IAcceptExchangeServerLicenseTerms /mode:Install /r:EdgeTransport
    
  • 下面的示例在本地服务器上的指定文件夹中安装边缘传输服务器角色和管理工具。This example installs the Edge Transport server role and the management tools in the specified folder on the local server.

    Setup.exe /IAcceptExchangeServerLicenseTerms /mode:Install /r:ET /TargetDir:"D:\Exchange Server"
    

在无人参与安装模式下从服务器中卸载 ExchangeUninstall Exchange from servers in unattended mode

下面的示例从本地服务器上完全删除 Exchange,并从 Active Directory 中删除此服务器的 Exchange 配置。This example completely removes Exchange from the local server and removes the server's Exchange configuration from Active Directory.

Setup.exe /IAcceptExchangeServerLicenseTerms /mode:Uninstall

在无人参与安装模式下从 Active Directory 中删除预配的 Exchange 服务器对象Remove provisioned Exchange server objects from Active Directory in unattended mode

下面的示例_先_从 Active Directory 中删除预配的 Exchange 服务器对象 Exchange03,再在服务器上安装 Exchange(如果 Exchange 已安装在服务器上,命令便不起作用)。This example removes the provisioned Exchange server object named Exchange03 from Active Directory before Exchange is installed on the server (if Exchange is already installed on the server, the command won't work).

Setup.exe /IAcceptExchangeServerLicenseTerms /rprs:Exchange03

有关详细信息,请参阅委派安装 Exchange 服务器For more information, see Delegate the installation of Exchange servers.

在无人参与安装模式下在现有 Exchange 2016 邮箱服务器中添加和删除 UM 语言包Add and remove UM language packs from existing Exchange 2016 Mailbox servers in unattended mode

备注

这些过程不适用于 Exchange 2019。These procedures aren't available in Exchange 2019.

  • 下面的示例从指定文件夹在本地 Exchange 2016 邮箱服务器上安装俄语和西班牙语(西班牙)语言包。This example installs the Russian and Spain Spanish language packs on the local Exchange 2016 Mailbox server from the specified folder.

    Setup.exe /IAcceptExchangeServerLicenseTerms /AddUmLanguagePack:ru-RU,es-ES /SourceDir:"D:\UM Language Packs"
    
  • 下面的示例从本地 Exchange 2016 邮箱服务器中卸载韩语 UM 语言包。This example uninstalls the Korean UM language pack from the local Exchange 2016 Mailbox server.

    Setup.exe /IAcceptExchangeServerLicenseTerms /RemoveUmLanguagePack:ko-KR
    

后续步骤Next steps