当前位置:网站首页 > 更多 > 玩电脑 > 正文

[玩转系统] 将邮件队列移动到 Exchange Server 中的另一个位置

作者:精品下载站 日期:2024-12-14 18:13:57 浏览:15 分类:玩电脑

将邮件队列移动到 Exchange Server 中的另一个位置


Exchange 中的邮件队列数据库临时保存邮件的位置。这些消息正在等待进入下一阶段的处理或传送到目的地。最好的方法是将 Exchange Server 中的邮件队列移动到另一个位置,以防止 (C:) 驱动器磁盘空间不足。配置新的 Exchange Server 时,最佳做法是移动传输数据库 mail.que。在本文中,您将了解如何将 Exchange Server 中的邮件队列移动到另一个位置。我们将使用 PowerShell 脚本来移动 Exchange 传输队列。

为邮件队列数据库创建NTFS分区

在开始移动邮件队列数据库之前,我们将:

  • 在 Exchange Server 上添加新磁盘。

  • 创建并格式化一个新的 NTFS 分区(卷),分配单元大小为 64K。

  • 将卷命名为 Queue 并为其指定驱动器号 Q

注意:邮件队列数据库所需的文件系统是NTFS

获取磁盘状态

将磁盘添加到 Exchange Server 后,我们将为邮件队列数据库配置它。

以管理员身份运行 PowerShell,并获取有关运行 Get-Disk cmdlet 的系统中的磁盘的信息。

PS C:\> Get-Disk | Format-Table -AutoSize

Number Friendly Name       Serial Number                    HealthStatus OperationalStatus Total Size Partition Style
------ -------------       -------------                    ------------ ----------------- ---------- ---------------
0      VMware Virtual disk 6000c2905397f746b506a29e5ae7fe22 Healthy      Online                 60 GB GPT
1      VMware Virtual disk 6000c29893be5b047dad48219ca6a74b Healthy      Online                 10 GB GPT
2      VMware Virtual disk 6000c29efde88f55a88f2cd7bc6d82a1 Healthy      Online                 10 GB GPT
3      VMware Virtual disk 6000c29580298e701e4c6cb79979ad54 Healthy      Offline                10 GB RAW

我们要配置的磁盘显示为编号3,并且它处于离线状态。

[玩转系统] 将邮件队列移动到 Exchange Server 中的另一个位置

PowerShell 一行创建 NTFS 卷

3号磁盘的分区类型显示为RAW。我们将磁盘设置为在线并将分区初始化为GPT(GUID分区表)。将分区挂载为盘符(Q:),卷格式为 NTFS,分配单元大小为 64K。

我们建议在 Exchange 中的传输数据库卷上配置 64K 分配单元大小/块大小。新卷的名称将为“队列”。

PS C:\> Get-Disk 3 | Initialize-Disk -PartitionStyle GPT -PassThru | New-Partition -UseMaximumSize -DriveLetter Q | Format-Volume -FileSystem NTFS -AllocationUnitSize 65536 -NewFileSystemLabel Queue

DriveLetter FileSystemLabel FileSystem DriveType HealthStatus OperationalStatus SizeRemaining    Size
----------- --------------- ---------- --------- ------------ ----------------- -------------    ----
Q           Queue           NTFS       Fixed     Healthy      OK                      9.93 GB 9.97 GB

NTFS 卷已成功配置。在磁盘管理中验证磁盘。

[玩转系统] 将邮件队列移动到 Exchange Server 中的另一个位置

打开文件资源管理器并转到此电脑。验证队列磁盘是否显示。

[玩转系统] 将邮件队列移动到 Exchange Server 中的另一个位置

该卷是使用 NTFS 分区创建的,并显示在此电脑上。在下一步中,我们将验证一切是否就位。之后,我们将传输数据库移动到队列磁盘。

移动 Exchange 邮件队列数据库之前

在移动邮件队列数据库之前,最好做好准备并确保一切就绪。

Microsoft 创建了一个 PowerShell 脚本 Move-TransportDatabase.ps1。我们将使用该脚本将邮件队列数据库移动到另一个位置。该脚本位于脚本文件夹中。在以下路径中找到该脚本:

%ExchangeInstallPath%Scripts

确认 Move-TransportDatabase.ps1 出现在脚本目录中。

[玩转系统] 将邮件队列移动到 Exchange Server 中的另一个位置

启动文件资源管理器并转到以下路径:

%ExchangeInstallPath%TransportRoles\data\

传输角色文件夹(包括数据中的文件夹)将被移动到其他位置。在我们的示例中,是 (Q:) 驱动器。如果您想检查 mail.que 数据库,请打开 Queue 文件夹。

[玩转系统] 将邮件队列移动到 Exchange Server 中的另一个位置

验证完毕后,我们准备在 Exchange Server 中移动传输数据库。

移动 Exchange 邮件队列数据库

1. 以管理员身份运行 Exchange 命令行管理程序。

2. 将路径更改为默认 Exchange 脚本文件夹。

[PS] C:\>cd $ExScripts

3. 运行命令移动传输角色文件夹,包括邮件队列数据库。

该脚本将执行以下步骤:

  1. 计算它将移动的文件的大小。

  2. 检查磁盘上是否有可用空间。

  3. 创建具有权限的新文件夹。

  4. 停止 Microsoft Exchange 传输服务。

  5. 创建配置文件的备份。

  6. 移动文件。

  7. 启动 Microsoft Exchange 传输服务。

注意:使用PowerShell脚本时不会丢失邮件数据。

[PS] C:\Program Files\Microsoft\Exchange Server\V15\scripts>.\Move-TransportDatabase.ps1 -queueDatabasePath 'Q:\TransportRoles\data\Queue' -queueDatabaseLoggingPath 'Q:\TransportRoles\data\Queue' -iPFilterDatabasePath 'Q:\TransportRoles\data\IpFilter' -iPFilterDatabaseLoggingPath 'Q:\TransportRoles\data\IpFilter' -temporaryStoragePath 'Q:\TransportRoles\data\Temp'

Queue Database Logging : Original path is C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\data\Queue; New path is Q:\TransportRoles\data\Queue
Temporary Storage : Original path is C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\data\Temp; New path is Q:\TransportRoles\data\Temp
IP Filter Database Logging : Original path is C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\data\IpFilter; New path is Q:\TransportRoles\data\IpFilter
IP Filter Database : Original path is C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\data\IpFilter; New path is Q:\TransportRoles\data\IpFilter
Queue Database : Original path is C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\data\Queue; New path is Q:\TransportRoles\data\Queue
Required disk space: 2173698048 bytes. Target drive Q: has 10665787392 bytes free.
Required disk space: 2147483648 bytes. Target drive Q: has 10665787392 bytes free.
Required disk space: 2149580800 bytes. Target drive Q: has 10665787392 bytes free.
Required disk space: 2155945984 bytes. Target drive Q: has 10665787392 bytes free.
Required disk space: 2675908608 bytes. Target drive Q: has 10665787392 bytes free.
Creating Q:\TransportRoles\data\Queue.
Adding full control access to the directory for NetworkServiceSid.
Adding full control access to the directory for LocalSystemSid.
Adding full control access to the directory for BuiltinAdministratorsSid.
Creating Q:\TransportRoles\data\Temp.
Adding full control access to the directory for NetworkServiceSid.
Adding full control access to the directory for LocalSystemSid.
Adding full control access to the directory for BuiltinAdministratorsSid.
Creating Q:\TransportRoles\data\IpFilter.
Adding full control access to the directory for NetworkServiceSid.
Adding full control access to the directory for LocalSystemSid.
Adding full control access to the directory for BuiltinAdministratorsSid.
Q:\TransportRoles\data\IpFilter already exists. Skipping directory creation.
NetworkServiceSid already has full control to the directory.
LocalSystemSid already has full control to the directory.
BuiltinAdministratorsSid already has full control to the directory.
Q:\TransportRoles\data\Queue already exists. Skipping directory creation.
NetworkServiceSid already has full control to the directory.
LocalSystemSid already has full control to the directory.
BuiltinAdministratorsSid already has full control to the directory.
Preparing to stop the MSExchangeTransport service...
WARNING: Waiting for service 'Microsoft Exchange Transport (MSExchangeTransport)' to stop...
MSExchangeTransport service is stopped successfully.
Saving a copy of original configuration file in C:\Program Files\Microsoft\Exchange Server\V15\bin\EdgeTransport.exe.config.20200504191948.old.
File trn.log has moved to the destination.
File trn00000004.log has moved to the destination.
File trntmp.log has moved to the destination.
File Trnres00001.jrs has moved to the destination.
File Trnres00002.jrs has moved to the destination.
Skipping file Temp.edb because it doesn't exist.
Queue Database Logging path is updated to Q:\TransportRoles\data\Queue
Temporary Storage path is updated to Q:\TransportRoles\data\Temp
File trn.log has moved to the destination.
File trntmp.log has moved to the destination.
File Trnres00001.jrs has moved to the destination.
File Trnres00002.jrs has moved to the destination.
Skipping file Temp.edb because it doesn't exist.
IP Filter Database Logging path is updated to Q:\TransportRoles\data\IpFilter
File IPFiltering.edb has moved to the destination.
File trn.chk has moved to the destination.
IP Filter Database path is updated to Q:\TransportRoles\data\IpFilter
File mail.que has moved to the destination.
File trn.chk has moved to the destination.
Queue Database path is updated to Q:\TransportRoles\data\Queue
Preparing to start the MSExchangeTransport service...
WARNING: Waiting for service 'Microsoft Exchange Transport (MSExchangeTransport)' to start...
MSExchangeTransport service is started successfully.
Script execution completed successfully.

传输角色数据文件夹已成功移动到(Q:)驱动器

移动后验证 Exchange 队列数据库文件

启动文件资源管理器。验证新位置中的文件夹。

[玩转系统] 将邮件队列移动到 Exchange Server 中的另一个位置

打开队列文件夹并验证文件是否存在于新位置:

  • 队列数据库文件mail.quetrn.chk

  • 事务日志文件 trn.logtrntmp.logtrnres00001.jrstrnres00002.jrs >tmp.edb。尽管 temp.edb 不是事务日志文件,但它与事务日志文件保存在同一位置。

[玩转系统] 将邮件队列移动到 Exchange Server 中的另一个位置

很高兴了解 EdgeTransport.exe.config

我们可以在CONFIG文件EdgeTransport.exe.config中找到配置的值。 XML 应用程序配置文件与 Exchange 传输服务关联。在以下路径中找到它:

%ExchangeInstallPath%Bin

运行 PowerShell 脚本后,EdgeTransport.exe.config 被重命名。 日期.old附加到配置名称中。您可以使用记事本打开 .config.old 文件。

[玩转系统] 将邮件队列移动到 Exchange Server 中的另一个位置

比较两个文件中的以下键:

  • 队列数据库路径

  • 队列数据库日志记录路径

  • IP过滤器数据库路径

  • IP过滤器数据库日志记录路径

  • 临时存储路径

移动数据库队列数据库之前

[玩转系统] 将邮件队列移动到 Exchange Server 中的另一个位置

移动数据库队列数据库后

[玩转系统] 将邮件队列移动到 Exchange Server 中的另一个位置

现在您已将邮件队列数据库移至另一个位置,跟踪起来会更容易。监控团队将收到队列磁盘已满的通知,并立即知道这是邮件队列数据库。

重要提示:完成上述更改后,您需要编辑 Antimalware.xml 设置文件中的 UnifiedContent 文件夹路径,以免临时日志填满 UnifiedContent 文件夹。

本文是否帮助您将 Exchange 传输队列移动到另一个位置?

阅读更多:

  • Mail.que 文件在 Exchange Server 中增长,用于检查安全网值并进行调整

  • Mail.que 文件大小较大 Exchange Server 以新的 mail.que 数据库文件启动

结论 移动邮件队列 Exchange Server

您学习了如何将 Exchange Server 中的邮件队列移动到另一个位置。首先,我们为队列数据库创建一个单独的磁盘卷。其次,我们使用 PowerShell 脚本 Move-TransportDatabase.ps1 移动传输数据库。截至最后,我们验证了新位置中移动的文件。我建议使用 Microsoft 的脚本来移动 Exchange 传输数据库队列。

您喜欢这篇文章吗?您可能还喜欢 Exchange 数据库最佳实践。不要忘记关注我们并分享这篇文章。

您需要 登录账户 后才能发表评论

取消回复欢迎 发表评论:

关灯