配置 Exchange Server 2019 自动发现URL
步骤1:在Exchange2019邮箱服务器上打开Exchange命令行管理程序。
步骤2:查看Exchange2019服务器上的SCP对象配置。
Get-ExchangeServer | Where {($_.AdminDisplayVersion -Like "Version 15.2*") -And ($_.ServerRole -Like "*Mailbox*")} | Get-ClientAccessService | Format-Table Name, AutoDiscoverServiceInternalUri -Auto

步骤3:将Exchange2019邮箱服务器的自动发现主机名存储在将在下一步中使用的变量中。例如,autodiscover.victor.cn。
$AutodiscoverHostName="autodiscover.victor.cn"

步骤4:运行以下命令将每台Exchange2019服务器上的SCP对象设置为新Exchange 2019服务器的自动发现URL。
Get-ExchangeServer | Where {($_.AdminDisplayVersion -Like "Version 15.2*") -And ($_.ServerRole -Like "*Mailbox*")} | Set-ClientAccessService -AutoDiscoverServiceInternalUri https://$AutodiscoverHostName/Autodiscover/Autodiscover.xml

步骤5:运行以下命令以查看Exchange2019服务器上的SCP对象配置。
Get-ExchangeServer | Where {($_.AdminDisplayVersion -Like "Version 15.2*") -And ($_.ServerRole -Like "*Mailbox*")} | Get-ClientAccessService | Format-Table Name, AutoDiscoverServiceInternalUri -Auto

输入密钥激活 Exchange Server 2019
步骤1:登录Exchange管理中心。
https://10.10.10.13/ecp

步骤2:重启Microsoft Exchange Information Store服务生效。
Get-Service -ComputerName Srv2019MBX01,Srv2019MBX02 -Name MSExchangeIS | Restart-Service -Verbose

安装有效的SSL证书
步骤1:在Exchange2019邮箱服务器上打开Exchange命令行管理程序,执行如下脚本创建 Base64编码的邮件服务器证书请求文件。
$txtrequest = New-ExchangeCertificate -PrivateKeyExportable $True -GenerateRequest -FriendlyName mail.corp.victor.cn -SubjectName "C=CN,S=BJ,L=BJ,O=CORP,OU=IT,CN=mail.corp.victor.cn" -DomainName mail.corp.victor.cn,autodiscover.corp.victor.cn,active.corp.victor.cn,corp.victor.cn,Srv2019MBX01.corp.victor.cn,Srv2019MBX02.corp.victor.cn -KeySize 2048 -Server Srv2019MBX01.corp.victor.cn
[System.IO.File]::WriteAllBytes('\\Srv2019MBX01.corp.victor.cn\C$\mailcert.req', [System.Text.Encoding]::Unicode.GetBytes($txtrequest))




步骤2:用Base64编码的邮件服务器证书请求文件向证书服务器请求邮件服务器证书。
登录"证书服务器",http://10.10.10.20/certsrv/
点击"申请证书"。

点击-"高级证书申请"。

选择-"用Base64编码的证书请求文件请求证书 "。

粘贴"证书请求文件"到"保存的申请",选择"Web服务器"证书模板,点击"提交"。

选择-"*载下**证书"(Base64编码)到邮件服务器。


步骤3:完成"搁置的证书请求"。
Import-ExchangeCertificate -FileData ([System.IO.File]::ReadAllBytes('\\Srv2019MBX01.corp.victor.cn\C$\certnew.cer')) -Password (ConvertTo-SecureString -String 'P@ssw0rd1' -AsPlainText -Force)


步骤3:点击"修改",分配给证书"服务",点击"保存"。

覆盖证书:

证书导入成功:

步骤4:"导出"Srv2019MBX01上使用的"邮件服务器证书"。
$cert = Export-ExchangeCertificate -Thumbprint DE5CA7FBECA81C2750E2B8B95FA160632AF112F3 -BinaryEncoded -Password (ConvertTo-SecureString -String 'P@ssw0rd1' -AsPlainText -Force)
[System.IO.File]::WriteAllBytes('\\Srv2019MBX01.corp.victor.cn\C$\certnew.pfx', $cert.FileData)

步骤5:"导入"Srv2019MBX01"邮件服务器",分配给证书服务。
Import-ExchangeCertificate -FileData ([System.IO.File]::ReadAllBytes('\\Srv2019MBX01.corp.victor.cn\C$\certnew.pfx')) -Password (ConvertTo-SecureString -String 'P@ssw0rd1' -AsPlainText -Force)

步骤7:点击"修改",分配给证书"服务",点击"保存"。

覆盖证书:

证书导入成功:

步骤8:访问网页邮箱:https://mail.corp.victor.cn/ecp,SSL证书已生效。


配置客户端访问
步骤1:查询当前URLs虚拟目录。
以管理员身份打开EMS,切换到脚本路径。
cd C:\PS
.\GetExchangeURLs.ps1 -Server Srv2019MBX01

步骤2:批量设置EXCHANGE 2019 URLS。
.\ConfigureExchangeURLs.ps1 -Server Srv2019MBX01 -InternalURL mail.corp.victor.cn -ExternalURL mail.corp.victor.cn
.\ConfigureExchangeURLs.ps1 -Server Srv2019MBX02 -InternalURL mail.corp.victor.cn -ExternalURL mail.corp.victor.cn

步骤3:验证Exchange 2019 URLS。
cd C:\PS
.\GetExchangeURLs.ps1 -Server Srv2019MBX01,Srv2019MBX02

OWA/ECP身份认证配置
步骤1:新安装的Exchange 2019服务器的默认OWA身份验证设置为:" 基于表单的身份验证 "。

步骤2:查看"身份认证设置"。
Get-ClientAccessService Srv2019MBX01 |Get-OwaVirtualDirectory | Select ServerName,LogonFormat,DefaultDomain
Get-ClientAccessService Srv2019MBX02 |Get-OwaVirtualDirectory | Select ServerName,LogonFormat,DefaultDomain

步骤3:修改身份认证设置-"默认域"-"支持仅用户名登录"。
Get-ClientAccessService Srv2019MBX01 |Get-OwaVirtualDirectory | Set-OwaVirtualDirectory -LogonFormat UserName -DefaultDomain "corp.victor.cn"
IISRESET
Get-ClientAccessService Srv2019MBX01 |Get-OwaVirtualDirectory | Select ServerName,LogonFormat,DefaultDomain
Get-ClientAccessService Srv2019MBX02 |Get-OwaVirtualDirectory | Set-OwaVirtualDirectory -LogonFormat UserName -DefaultDomain "corp.victor.cn"
IISRESET
Get-ClientAccessService Srv2019MBX02 |Get-OwaVirtualDirectory | Select ServerName,LogonFormat,DefaultDomain

重建ActiveSync虚拟目录
步骤1:在IIS管理器中添加一个名称为ActiveSync的网站站点。
网站名称: ActiveSync
物理路径: C:\inetpub\wwwroot
IP地址: ActiveSync IP地址
选择-" SSL证书 "

步骤2:默认站点添加" IP绑定 "。
打开" Default Web Site "-" 添加 "-" IP地址 "
选择" SSL证书 "

步骤3:新建ActiveSync虚拟目录。
New-ActiveSyncVirtualDirectory -Server Srv2019MBX01.corp.victor.cn -WebSiteName "ActiveSync" -ExternalUrl https://active.victor.cn/Microsoft-Server-ActiveSync -InternalUrl https://active.victor.cn/Microsoft-Server-ActiveSync
New-ActiveSyncVirtualDirectory -Server Srv2019MBX02.corp.victor.cn -WebSiteName "ActiveSync" -ExternalUrl https://active.victor.cn/Microsoft-Server-ActiveSync -InternalUrl https://active.victor.cn/Microsoft-Server-ActiveSync

步骤4:移除默认的ActiveSync虚拟目录
Remove-ActiveSyncVirtualDirectory -identity "Srv2019MBX01\Microsoft-Server-ActiveSync (Default Web Site)"
Remove-ActiveSyncVirtualDirectory -identity "Srv2019MBX02\Microsoft-Server-ActiveSync (Default Web Site)"

步骤5:查询ActiveSync虚拟目录。
Get-ActiveSyncVirtualDirectory -Server Srv2019MBX01
Get-ActiveSyncVirtualDirectory -Server Srv2019MBX02

IIS重定向配置
步骤1:Default Web Site 默认站点, 参考如下配置。
使用 IIS 管理器从默认网站中删除 "要求 SSL" 设置 (CMD运行)。
%windir%\system32\inetsrv\appcmd*ex.e** set config "Default Web Site" -section:access -sslFlags:None -commit:APPHOST
使用 IIS 管理器在默认网站中的其他虚拟目录上还原 "要求 SSL" 设置(CMD运行)。
%windir%\system32\inetsrv\appcmd*ex.e** set config "Default Web Site/API" -section:Access -sslFlags:Ssl,Ssl128 -commit:APPHOST
%windir%\system32\inetsrv\appcmd*ex.e** set config "Default Web Site/aspnet_client" -section:Access -sslFlags:Ssl,Ssl128 -commit:APPHOST
%windir%\system32\inetsrv\appcmd*ex.e** set config "Default Web Site/Autodiscover" -section:Access -sslFlags:Ssl,Ssl128 -commit:APPHOST
%windir%\system32\inetsrv\appcmd*ex.e** set config "Default Web Site/ecp" -section:Access -sslFlags:Ssl,Ssl128 -commit:APPHOST
%windir%\system32\inetsrv\appcmd*ex.e** set config "Default Web Site/EWS" -section:Access -sslFlags:Ssl,Ssl128 -commit:APPHOST
%windir%\system32\inetsrv\appcmd*ex.e** set config "Default Web Site/mapi" -section:Access -sslFlags:Ssl,Ssl128 -commit:APPHOST
%windir%\system32\inetsrv\appcmd*ex.e** set config "Default Web Site/Microsoft-Server-ActiveSync" -section:Access -sslFlags:Ssl,Ssl128 -commit:APPHOST
使用 IIS 管理器将默认网站配置为重定向到/owa 虚拟目录(CMD运行)。
%windir%\system32\inetsrv\appcmd*ex.e** set config "Default Web Site" -section:httpredirect -enabled:true -destination:"/owa" -childOnly:true
使用 IIS 管理器从默认网站中的所有虚拟目录中删除 http 重定向(CMD运行)。
%windir%\system32\inetsrv\appcmd*ex.e** set config "Default Web Site/API" -section:httpredirect -enabled:false -destination:"" -childOnly:false
%windir%\system32\inetsrv\appcmd*ex.e** set config "Default Web Site/aspnet_client" -section:httpredirect -enabled:false -destination:"" -childOnly:false
%windir%\system32\inetsrv\appcmd*ex.e** set config "Default Web Site/Autodiscover" -section:httpredirect -enabled:false -destination:"" -childOnly:false
%windir%\system32\inetsrv\appcmd*ex.e** set config "Default Web Site/ecp" -section:httpredirect -enabled:false -destination:"" -childOnly:false
%windir%\system32\inetsrv\appcmd*ex.e** set config "Default Web Site/EWS" -section:httpredirect -enabled:false -destination:"" -childOnly:false
%windir%\system32\inetsrv\appcmd*ex.e** set config "Default Web Site/mapi" -section:httpredirect -enabled:false -destination:"" -childOnly:false
%windir%\system32\inetsrv\appcmd*ex.e** set config "Default Web Site/Microsoft-Server-ActiveSync" -section:httpredirect -enabled:false -destination:"" -childOnly:false
%windir%\system32\inetsrv\appcmd*ex.e** set config "Default Web Site/OAB" -section:httpredirect -enabled:false -destination:"" -childOnly:false
%windir%\system32\inetsrv\appcmd*ex.e** set config "Default Web Site/owa" -section:httpredirect -enabled:false -destination:"" -childOnly:false
%windir%\system32\inetsrv\appcmd*ex.e** set config "Default Web Site/Powershell" -section:httpredirect -enabled:false -destination:"" -childOnly:false
%windir%\system32\inetsrv\appcmd*ex.e** set config "Default Web Site/Rpc" -section:httpredirect -enabled:false -destination:"" -childOnly:false
使用 IIS 管理器重新启动 IIS
iisreset
步骤2: ActiveSync 手机邮箱站点, 参考如下配置。
从ActiveSync站点中删除 "要求 SSL" 设置(CMD运行)。
%windir%\system32\inetsrv\appcmd*ex.e** set config "ActiveSync" -section:access -sslFlags:None -commit:APPHOST
配置为重定向到/owa 虚拟目录(CMD运行)。
%windir%\system32\inetsrv\appcmd*ex.e** set config "ActiveSync" -section:httpredirect -enabled:true -destination:"/owa" -childOnly:true
ActiveSync网站中的所有虚拟目录中删除 http 重定向(CMD运行)。
%windir%\system32\inetsrv\appcmd*ex.e** set config "ActiveSync/aspnet_client" -section:httpredirect -enabled:false -destination:"" -childOnly:false
%windir%\system32\inetsrv\appcmd*ex.e** set config "ActiveSync/Microsoft-Server-ActiveSync" -section:httpredirect -enabled:false -destination:"" -childOnly:false
使用 IIS 管理器重新启动 IIS
iisreset
配置传输服务器
步骤1:查询接收连接器配置。

Get-ReceiveConnector |select *

步骤2:新建支持匿名接收连接器。
New-ReceiveConnector -Name AnonymousReceiveConnector -Usage Custom -Bindings 0.0.0.0:25 -RemoteIPRanges 10.10.10.11 -TransportRole FrontendTransport -Server Srv2019MBX01
New-ReceiveConnector -Name AnonymousReceiveConnector -Usage Custom -Bindings 0.0.0.0:25 -RemoteIPRanges 10.10.10.11 -TransportRole FrontendTransport -Server Srv2019MBX02

步骤3:配置匿名接收连接器,接收匿名用户邮件.

步骤4:批量配置接收连接器。
$ReceiveConnector = Get-ReceiveConnector
foreach ($identity in $ReceiveConnector) {
Set-ReceiveConnector -identity $identity.name -AuthMechanism Tls,Integrated,BasicAuth,ExchangeServer -SmtpUtf8Enabled $false -DomainSecureEnabled $false -MaxInboundConnection unlimited -MaxInboundConnectionPerSource Unlimited -MaxInboundConnectionPercentagePerSource 100 -MaxMessageSize 30MB -MaxRecipientsPerMessage 5000 -PermissionGroups AnonymousUsers,ExchangeServers,ExchangeLegacyServers,ExchangeUsers}
步骤5:查询和设置传输服务器邮件限制。
Get-TransportServer | ft MaxConcurrent*,MaxConnection*,Max*OutboundConnections,name
Get-TransportService | Set-TransportService -MaxConcurrentMailboxDeliveries 100 -MaxConnectionRatePerMinute 10000

步骤6:接收连接器邮件限制。
Get-ReceiveConnector | ? {$_.name -like "*default*"} | ft Name,Connection*,MaxInbound*,MessageRate*,TarpitInterval
Get-ReceiveConnector | ?{$_.name -like "*default*"} | set-ReceiveConnector -MaxInboundConnection unlimited

步骤7:新建发送连接器。
名称:Internet

网络设置:与收件人域关联的MX记录

地址空间:类型:SMTP;域:*;成本:1

源服务器:邮件服务器列表

发送连接器配置截图:


