Ir al contenido principal

Identificar carpetas de buzón no migrables con PowerShell

Utiliza un script de PowerShell para encontrar tipos de carpeta de buzón que ShareGate Migrate no puede detectar o migrar.

Nota: La integración con PowerShell requiere una suscripción Pro o Enterprise de ShareGate Migrate. No está disponible en el plan Essentials.

El script identifica dos tipos de carpetas de buzón que ShareGate Migrate no copiará:

  • No detectadas — carpetas con clases de contenedor no estándar (como IPF.Imap o IPF.SkypeTeams.Message) que ShareGate Migrate no puede ver. Estas carpetas no aparecen en tu informe de migración.

  • Omitidas por diseño — carpetas de sistema conocidas que ShareGate Migrate detecta pero no copia: ConversationHistory, Clutter, SyncIssues, Conflicts, LocalFailures, ServerFailures, RecoverableItemsDeletions y SearchFolders. Estas tampoco se marcan en el informe de migración.

Ejecuta Get-NonMigratableMailboxFolders.ps1 antes o después de una migración para identificar ambos tipos y evaluar cualquier brecha en la cobertura.

Requisitos previos

  • Windows PowerShell (se recomienda usar la línea de comandos para mejores resultados)

  • Acceso al buzón de origen con permisos de Exchange Online

Ejecutar el script

Copia el siguiente script y guárdalo como Get-NonMigratableMailboxFolders.ps1, luego ejecútalo desde la línea de comandos.

param(
# Change this to the mailbox you want to scan
[Parameter(Mandatory = $true)]
[string]$Mailbox,

# Optional: provide a file path to also export the results as a CSV
[Parameter(Mandatory = $false)]
[string]$CsvOutputPath
)

$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
}

Import-Module -Name $ModuleName -RequiredVersion $RequiredVersion -Force

Connect-ExchangeOnline -ShowBanner:$false

try {
Write-Host "Scanning mailbox: $Mailbox" -ForegroundColor Cyan

$folders = Get-MailboxFolderStatistics -Identity $Mailbox |
Select-Object Name, FolderPath, FolderType, ContainerClass

$nonDetectable = @($folders | Where-Object {
$class = $_.ContainerClass
-not (
[string]::IsNullOrEmpty($class) -or
$class -eq 'IPF.Note' -or $class -like 'IPF.Note.*' -or
$class -eq 'IPF.Appointment' -or $class -like 'IPF.Appointment.*' -or
$class -eq 'IPF.Contact' -or $class -like 'IPF.Contact.*' -or
$class -eq 'IPF.Task' -or $class -like 'IPF.Task.*'
)
})

$skippedFolderTypes = @(
'ConversationHistory',
'Clutter',
'SyncIssues',
'Conflicts',
'LocalFailures',
'ServerFailures',
'RecoverableItemsDeletions',
'SearchFolders'
)
$skippedByDesign = @($folders | Where-Object { $skippedFolderTypes -contains $_.FolderType })

if ($nonDetectable.Count -eq 0) {
Write-Host "No non-detectable folders found." -ForegroundColor Green
}
else {
Write-Host "`nFolders that will NOT be detected by ShareGate ($($nonDetectable.Count) found):" -ForegroundColor Yellow
$nonDetectable | Format-Table Name, FolderPath, FolderType, ContainerClass -AutoSize
}

if ($skippedByDesign.Count -eq 0) {
Write-Host "No folders skipped by design found." -ForegroundColor Green
}
else {
Write-Host "`nFolders that ShareGate detects but skips by design ($($skippedByDesign.Count) found):" -ForegroundColor Yellow
$skippedByDesign | Format-Table Name, FolderPath, FolderType, ContainerClass -AutoSize
}

if ($CsvOutputPath) {
$report = @()
$report += $nonDetectable | Select-Object @{ Name = 'Reason'; Expression = { 'NotDetected' } }, Name, FolderPath, FolderType, ContainerClass
$report += $skippedByDesign | Select-Object @{ Name = 'Reason'; Expression = { 'SkippedByDesign' } }, Name, FolderPath, FolderType, ContainerClass
$report | Export-Csv -LiteralPath $CsvOutputPath -NoTypeInformation -Encoding UTF8
Write-Host "Report exported to: $CsvOutputPath" -ForegroundColor Green
}
}
finally {
Disconnect-ExchangeOnline -Confirm:$false
}

Para mostrar los resultados en la consola:

.\Get-NonMigratableMailboxFolders.ps1 -Mailbox "[email protected]"

Para exportar los resultados a un archivo CSV:

.\Get-NonMigratableMailboxFolders.ps1 -Mailbox "[email protected]" -CsvOutputPath "C:\Reports\non-migratable-folders.csv"

El archivo exportado incluye una columna Reason con el valor NotDetected o SkippedByDesign para cada carpeta.

Solución de problemas

Error al instalar el módulo

Si ves un error cuando el script intenta instalar el módulo ExchangeOnlineManagement, abre el script en un editor de texto y agrega -AllowClobber a la línea de Install-Module:

Install-Module -Name $ModuleName -RequiredVersion $RequiredVersion -Scope CurrentUser -Force -AllowClobber


"Este artículo fue traducido usando inteligencia artificial. Si tienes dudas, consulta la versión original en inglés."

¿Ha quedado contestada tu pregunta?