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

[玩转系统] 使用 PowerShell 查看和导出有关邮箱迁移到 Office 365 的信息 |第 4 部分#5

作者:精品下载站 日期:2024-12-14 09:06:44 浏览:14 分类:玩电脑

使用 PowerShell 查看和导出有关邮箱迁移到 Office 365 的信息 |第 4 部分#5


当前文章是上一篇文章的延续,其中我们回顾了可用于查看和导出有关 Exchange 邮箱迁移过程的信息的各种 PowerShell cmdlet。

我们在本文中回顾的“邮箱迁移”PowerShell 命令是:

  • 获取迁移统计信息
  • 获取迁移用户
  • 获取迁移用户统计信息

此外,我们还回顾了可用于获取有关本地环境信息的 PowerShell 命令。

1. 移民统计|获取迁移统计信息

获取+导出信息|迁移统计

PowerShell 命令 Get-MigrationStatistics 使用同步计数、总计数等属性向我们提供有关迁移过程的信息。

获取有关迁移统计信息

PowerShell 命令语法

Get-MigrationStatistics -Diagnostic

PowerShell 控制台输出示例

PS C:\> Get-MigrationStatistics -Diagnostic

MigrationType       TotalCount FailedCount SyncedCount
-------------       ---------- ----------- -----------
ExchangeRemoteMove  4          0           0

获取+导出有关迁移统计信息 |例子

Get-MigrationStatistics -Diagnostic |Format-List | Out-File c:\temp\"Get-MigrationStatistics -Diagnostic.txt" -Encoding UTF8

迁移用户

获取+导出信息|迁移用户

如前所述,每个 Exchange 邮箱必须有一个与该邮箱(邮箱所有者)关联的“用户帐户”。

我们用于获取有关“附加”到我们迁移的邮箱的用户帐户信息的 PowerShell 命令是:

  • 获取迁移用户
  • 获取迁移用户统计信息

2.获取迁移用户信息|获取迁移用户

PowerShell 命令 Get-MigrationUser 显示有关与我们迁移的 Exchange 邮箱关联的用户帐户属性的信息 + 有关邮箱迁移内容的高级信息。

获取有关特定“迁移用户”的信息

PowerShell 命令语法

Get-MigrationUser <Migrated user account>

PowerShell 控制台输出示例

PS C:\> Get-MigrationUser [email protected]

Identity                   Batch                      Status     LastSyncTime 
--------                   -----                      ------     ------------ 
[email protected]  Eyal Migration batch -001  Completed  2/23/2017 10:47:28 AM

导出有关特定“迁移用户”的信息 | TXT文件

Get-MigrationUser [email protected] |Format-List | Out-File c:\temp\"Get-MigrationUser - [email protected]" -Encoding UTF8

导出有关所有“迁移用户”的信息 | TXT文件

要获取有关所有“迁移用户”的信息+将信息导出到文本文件,我们可以使用 PowerShell 命令示例。

PowerShell 命令示例:

Get-MigrationUser | Format-List | Out-File c:\temp\"Get-MigrationUser.txt" -Encoding UTF8

导出有关所有“迁移用户”的信息 |查看具体属性 | TXT文件

如果我们想要“优化”结果并查看最相关的信息,我们可以使用以下 PowerShell 语法。

PowerShell 命令示例:

Get-MigrationUser | Select Identity,RecipientType,SkippedItemCount,SyncedItemCount,Status,BatchId,LastSuccessfulSyncTime | Out-File c:\temp\"Get-MigrationUser.txt" -Encoding UTF8

3.获取迁移用户统计信息|获取迁移用户统计信息

PowerShell 命令 Get-MigrationUserStatistics 将为我们提供有关与我们迁移的邮箱关联的“已迁移用户”的其他信息以及有关邮箱内容(即迁移的邮件项目)的更多详细信息。

获取有关特定“迁移用户统计信息”的信息

PowerShell 命令语法

Get-MigrationUserStatistics <Migrated user account>

PowerShell 控制台输出示例

PS C:\> Get-MigrationUserStatistics [email protected]

Identity                   Batch                      Status     Items Synced  Items Skipped 
--------                   -----                      ------     ------------  ------------- 
[email protected]  Eyal Migration batch -001  Completed  4             0

导出有关特定“迁移用户统计信息”的信息 | TXT文件

Get-MigrationUserStatistics [email protected] | Format-List | Out-File c:\temp\"Get-MigrationUser.txt" -Encoding UTF8

导出有关特定“迁移用户统计”的信息+更详细的信息 | TXT文件

在这种情况下,我们添加以下附加参数: IncludeReport 、 Diagnostic 和 IncludeSkippedItems 可以帮助我们获取更多详细信息。

PowerShell 命令示例:

Get-MigrationUserStatistics [email protected] -IncludeReport -Diagnostic -IncludeSkippedItems | Format-List | Out-File c:\temp\"Get-MigrationUser.txt" -Encoding UTF8

导出“迁移用户统计”所有迁移用户+详细信息| XML文件

在这种情况下,我们获得有关所有现有“迁移用户”的最详细的统计信息,并将该信息导出到 XML 文件。

PowerShell 命令示例:

Get-MigrationUserStatistics -IncludeReport -Diagnostic -IncludeSkippedItems| Export-CliXml c:\temp\"Get-MigrationUserStatistics -IncludeReport -Diagnostic.xml" -Encoding UTF8

5. 本地基础设施信息

当前的文章系列专门针对 Office 365 和 Exchange Online 环境,但在某些故障排除场景中,我们需要获取有关“本地基础设施”的更多信息。

例如,我们收到与特定用户或特定邮箱相关的迁移错误。
我们怀疑该问题可能是本地 Active Directory 用户帐户问题或“有问题的 Exchange”的实际问题。本地邮箱”。

本地 Active Directory

导出有关本地 Active Directory 用户的信息

要获取有关特定 Active Directory 用户帐户的信息并将信息导出到 TXT 文件,我们可以使用以下 PowerShell 命令。

PowerShell 命令示例:

Get-Aduser [email protected] -Properties * | Format-List | Out-File c:\temp\[email protected] -Active Directory user.TXT

注意:以下 PowerShell 命令应使用域控制器服务器或包含 Active Directory PowerShell cmdlet 的服务器从本地环境执行。

Exchange 本地基础设施

要获取有关特定 Exchange 本地邮箱的信息,我们可以使用以下两个 PowerShell 命令:

  • 获取邮箱
  • 获取邮箱统计信息

注意:以下 PowerShell 命令应使用 Exchange 本地 PowerShell 从本地环境执行。

获取邮箱 PowerShell 命令

要获取有关特定 Exchange 本地邮箱的信息 + 将信息导出到 TXT 文件,我们可以使用以下语法:

导出有关 Exchange 本地邮箱的信息

PowerShell 命令示例:

Get-Mailbox [email protected] | Format-List | Out-File c:\temp\[email protected] on-Premises.txt

获取 MailboxStatistics PowerShell 命令

PowerShell命令Get-MailboxStatistics,可以帮助我们获得有关Exchange邮箱“结构”的非常详细的信息,其中包括有关每个邮箱文件夹的信息、每个文件夹中的邮件项目数量等等。

导出有关 Exchange 本地邮箱统计信息 | TXT文件

Get-MailboxStatistics [email protected] | Format-List | Out-File c:\temp\"[email protected]" -Get-MailboxStatistics on-Premises.txt
Get-MailboxStatistics [email protected] -IncludeMoveHistory| Export-CSV c:\temp\"[email protected] -Get-MailboxStatistics on-Premises - IncludeMoveHistory.CSV" -NoTypeInformation -Encoding utf8

下载邮件迁移 PowerShell 脚本

当前文章系列的下一篇文章

如何使用PowerShell脚本导出邮箱迁移信息及故障排除第 5 部分#5

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

取消回复欢迎 发表评论:

关灯