使用此过程为邮箱服务器上的传输服务和边缘传输服务器上的传输服务中的所有发送连接器或接收连接器配置协议日志设置。 若要在 Exchange 命令行管理程序中配置协议日志设置,请使用以下语法:
<Set-FrontEndTransportService | Set-MailboxTransportService | Set-TransportService> <ServerIdentity> -ReceiveProtocolLogPath <LocalFilePath> -ReceiveProtocolLogMaxFileSize <Size> -ReceiveProtocolLogMaxDirectorySize <Size> -ReceiveProtocolLogMaxAge <dd.hh:mm:ss> -SendProtocolLogPath <LocalFilePath> -SendProtocolLogMaxFileSize <Size> -SendProtocolLogMaxDirectorySize <Size> -SendProtocolLogMaxAge <dd.hh:mm:ss>
本示例将在名为 Mailbox01 的服务器上的传输服务中设置以下协议日志设置: 将所有接收连接器的协议日志位置设置为 D:\Hub SMTP Receive Log,并将所有发送连接器的协议日志位置设置为 D:\Hub SMTP Send Log。如果文件夹不存在,系统会为你创建该文件夹。 将接收连接器和发送连接器的连接器协议日志文件的最大大小设置为 20 MB。 将接收连接器和发送连接器的连接器协议日志文件夹的最大大小设置为 400 MB。 将接收连接器和发送连接器的协议日志文件的最长期限设置为 45 天。
Set-TransportService Mailbox01 -ReceiveProtocolLogPath "D:\Hub SMTP Receive Log" -ReceiveProtocolLogMaxFileSize 20MB -ReceiveProtocolLogMaxDirectorySize 400MB -ReceiveProtocolLogMaxAge 45.00:00:00 -SendProtocolLogPath "D:\Hub SMTP Send Log" -SendProtocolLogMaxFileSize 20MB -SendProtocolLogMaxDirectorySize 400MB -SendProtocolLogMaxAge 45.00:00:00
注意:
将 SendProtocolLogPath 或 ReceiveProtocolLogPath 参数设置为值 $null 会有效禁用服务器上所有发送连接器或接收连接器的协议日志记录。但是,当对该服务器上的任何发送连接器或接收连接器(包括组织内发送连接器或邮箱传递接收连接器)启用协议日志记录时,将此值设置为 $null 将生成事件日志错误。 将 ReceiveProtocolLogMaxAge 或 SendProtocolLogMaxAge 参数的值设置为 00:00:00 ,可以防止由于期限问题而自动删除协议日志文件。
若要验证是否成功使用 Exchange 命令行管理程序在 Exchange 服务器上配置协议日志记录设置,请执行以下步骤: 在 Exchange 命令行管理程序中运行以下命令,并在 Exchange 服务器上验证协议日志设置:
Write-Host "Front End Transport service:" -ForegroundColor yellow; Get-FrontEndTransportService | Format-List ReceiveProtocolLog*,SendProtocolLog*; Write-Host "Mailbox Transport Submission and Mailbox Transport Delivery services:" -ForegroundColor yellow; Get-MailboxTransportService | Format-List ReceiveProtocolLog*,SendProtocolLog*; Write-Host "Transport service:" -ForegroundColor yellow; Get-TransportService | Format-List ReceiveProtocolLog*,SendProtocolLog*
在 Windows 资源管理器或文件资源管理器中打开协议日志的位置,以验证该日志文件是否存在,是否正在向文件写入数据,以及文件是否根据所配置的最大文件大小和最大目录大小值进行回收。
|