注: PowerShellとの連携には、ShareGate MigrateのProまたはEnterpriseサブスクリプションが必要です。Essentialsプランでは利用できません。
Microsoft 365にメールボックスをコピーする際、特定の保持設定やホールドの設定が原因で、移行先の回復可能なアイテムフォルダーがいっぱいになることがあります。
最も多い原因は保持設定で、新しいExchange Onlineメールボックスでは既定で有効になっていることがよくあります。
ShareGate Migrateはこの潜在的な問題を検出し、影響を受けるメールボックスをレポートに一覧表示します。このレポートは、メールボックスの移行を開始する前に表示されるCopy Summary画面で確認できます。
問題のある保持設定を特定して無効にする方法
メールボックスの移行を開始する前に、問題のある保持設定を特定して無効にし、この記事のPowerShellスクリプトを使用して移行後に再度有効にすることができます。
Copy mailboxesまたはCopy from Gmailで移行を設定すると、いずれかのメールボックスに保持設定がある場合、Copy summary画面に警告メッセージが表示されます。
警告メッセージが表示されたら、Export list of Single Item Recovery valuesをクリックして、リストをドライブに保存します。次に、以下のスクリプトをエクスポートしたCSVファイルのパスで更新し、移行先環境に対して実行します。
スクリプトの実行が完了したら、移行を進める前に、設定がExchange Onlineに反映されるまで少なくとも4時間待ってください。
保持設定を無効にする
$CsvPath = Read-Host "Replace this message with the absolute path of the report you saved on your drive between these quotation marks"
$CsvPath = $CsvPath.Trim('"')
if (-not $CsvPath) {
Write-Error "No path provided. Exiting."
return
}
if (-not (Test-Path -LiteralPath $CsvPath)) {
Write-Error "File not found at '$CsvPath'. Exiting."
return
}
$ErrorActionPreference = 'Stop'
$ModuleName = "ExchangeOnlineManagement"
$RequiredVersion = "3.9.0"
$module = Get-Module -ListAvailable -Name $ModuleName | Where-Object {
$_.Version -eq [Version]$RequiredVersion
}
if (-not $module) {
Install-Module -Name $ModuleName -RequiredVersion $RequiredVersion `
-Scope CurrentUser -Force -AllowClobber
}
Import-Module -Name $ModuleName -RequiredVersion $RequiredVersion -Force
Connect-ExchangeOnline -ShowBanner:$false
try {
$rows = Import-Csv -LiteralPath $CsvPath
foreach ($r in $rows) {
$email = $r.EmailAddress
if ($r.SingleItemRecoveryEnabled -ieq 'true') {
Set-Mailbox -Identity $email -SingleItemRecoveryEnabled $false
Write-Host "Disabled SingleItemRecovery: $email"
}
}
}
finally {
Disconnect-ExchangeOnline -Confirm:$false
}
保持設定を復元する
以下のスクリプトをエクスポートしたCSVファイルのパスで更新して実行すると、移行先でホールドを再度有効にできます。
$CsvPath = Read-Host "Replace this message with the absolute path of the report you saved on your drive between these quotation marks"
$CsvPath = $CsvPath.Trim('"')
if (-not $CsvPath) {
Write-Error "No path provided. Exiting."
return
}
if (-not (Test-Path -LiteralPath $CsvPath)) {
Write-Error "File not found at '$CsvPath'. Exiting."
return
}
$ErrorActionPreference = 'Stop'
$ModuleName = "ExchangeOnlineManagement"
$RequiredVersion = "3.9.0"
$module = Get-Module -ListAvailable -Name $ModuleName | Where-Object {
$_.Version -eq [Version]$RequiredVersion
}
if (-not $module) {
Install-Module -Name $ModuleName -RequiredVersion $RequiredVersion `
-Scope CurrentUser -Force -AllowClobber
}
Import-Module -Name $ModuleName -RequiredVersion $RequiredVersion -Force
Connect-ExchangeOnline -ShowBanner:$false
try {
$rows = Import-Csv -LiteralPath $CsvPath
foreach ($r in $rows) {
$email = $r.EmailAddress
if ($r.SingleItemRecoveryEnabled -ieq 'true') {
Set-Mailbox -Identity $email -SingleItemRecoveryEnabled $true
Write-Host "Enabled SingleItemRecovery: $email"
}
}
}
finally {
Disconnect-ExchangeOnline -Confirm:$false
}
この記事はAIによって翻訳されています。ご不明な点がある場合は、英語の原文をご確認ください。
