0x01 前期工作
准备一台AD服务器,此处准备的AD的OS为2019STD
FQDN | 角色 | OS | IP |
DC.tt.org | DC&DNS | WinServer 2019 STD | 172.16.16.100 |
EX01.tt.org | WinServer 2019 STD | 172.16.16.163 |
将准备安装 Exchange 的服务器加入域中,并在 AD 中新建几个待测试的用户在 DNS 中做好两个解析地址,一个 A 记录指向待安装 Exchange 服务器的 IP,一个MX记录;
解析类别 | 解析域名 | 解析IP |
A记录 | mail.tt.org | 172.16.16.163 |
MX记录 | mail.tt.org | 172.16.16.163 |
0x02 必备插件
Microsoft .NET Framework https://go.microsoft.com/fwlink/?linkid=2088631
vc++ 2013 https://www.microsoft.com/zh-cn/download/confirmation.aspx?id=40784
IIS 重写 https://www.iis.net/downloads/microsoft/url-rewrite
添加所需的 Lync Server 或 Skype for Business Server 组件 Unified Communications Managed API 4.0 Exchange Server 媒体的 \UCMARedist 文件夹中;
Install-WindowsFeature Server-1 Media-Foundation
0x03 邮箱角色
Install-WindowsFeature Server-Media-Foundation, NET-Framework-45-Features,
RPC-over-HTTP-proxy, RSAT-Clustering, RSAT-Clustering-CmdInterface, RSATClustering-
Mgmt, RSAT-Clustering-PowerShell, WAS-Process-Model, Web-Asp-
Net45, Web-Basic-Auth, Web-Client-Auth, Web-Digest-Auth, Web-Dir-Browsing,
Web-Dyn-Compression, Web-Http-Errors, Web-Http-Logging, Web-Http-Redirect,
Web-Http-Tracing, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Lgcy-Mgmt-Console,
Web-Metabase, Web-Mgmt-Console, Web-Mgmt-Service, Web-Net-Ext45, Web-Request-
Monitor, Web-Server, Web-Stat-Compression, Web-Static-Content, Web-Windows-
Auth, Web-WMI, Windows-Identity-Foundation, RSAT-ADDS, Restart-Computer
0x04 边缘角色
Install-WindowsFeature ADLDS # 非必要操作;
Enable-WindowsOptionalFeature -Online -FeatureName IISManagementScriptingTools,
IIS-ManagementScriptingTools,IISIIS6ManagementCompatibility,
IIS-LegacySnapIn,IIS-ManagementConsole,IISMetabase,
IIS-WebServerManagementTools,IIS-WebServerRole, Restart-Computer
setup /preparead # 扩展AD架构,非必要操作,如果ad的os跟ex的os都是2019此步略过;
0x05 开始安装
# 使用powershell切换到安装介质中,x:为光驱盘符号,此处为使用powershell命令行安装
x:\.\Setup.exe /m:install /roles:m /IAcceptExchangeServerLicenseTerms
/InstallWindowsComponents
0x06 安装过程
以下为图形界面安装,进入安装介质(此处为挂在的ISO文件)中,双击Setup.exe 安装

















0x07 测试运行

首次安装完成后,进入ecp输入账号密码之后会出现错误提示 ASSERT:HMACProvider.GetCertificates:protectionCertificates.Length<1

此时,将时区改为 (UTC) 协调世界时 比 UTC+8 慢 8h,等 8h 之后再改回 UTC+8 即可这个问题由于首次安装,证书生效需要8小时,只能通过改时区生效,不能改时间切记。

修改时区后重启服务器;

如果非新装的,是更新或升级之后出现此报错,参考 https://docs.microsoft.com/zh-cn/exchange/troubleshoot/administration/cannot-access-owa-or-ecp-if-oauth-expired
检查现有 OAuth 证书的状态,请在命令行管理程序中Exchange命令:
(Get-AuthConfig).CurrentCertificateThumbprint | Get-ExchangeCertificate | Format-List
如果命令返回错误或证书已过期,请使用以下步骤创建新的 OAuth 证书,Exchange服务器,创建新的 OAuth 证书;
New-ExchangeCertificate -KeySize 2048 -PrivateKeyExportable $true - SubjectName "cn=Microsoft Exchange Server Auth Certificate" -FriendlyName "Microsoft Exchange Server Auth Certificate" -DomainName 'contoso.com'
设置用于服务器身份验证的新证书;
Set-AuthConfig -NewCertificateThumbprint <ThumbprintFromStep1> -NewCertificateEffectiveDate (Get-Date)
Set-AuthConfig -PublishCertificate
Set-AuthConfig -ClearPreviousCertificate
重新启动 Microsoft Exchange 服务主机 IISReset 以重新启动 IIS 或在提升模式下 (运行以下命令) 回收 Outlook 网页版 和 EAC 应用程序池;
Restart-WebAppPool MSExchangeOWAAppPool
Restart-WebAppPool MSExchangeECPAppPool