Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,32 @@ function Test-FolderLimit {
Write-Progress @progressParams -Status $progressCount -PercentComplete ($progressCount * 100 / $FolderData.IpmSubtree.Count)
}

# If we failed to get statistics for some reason, assume we have content
[int]$itemCount = 1
[Int64]$totalItemSize = 0
$aggregateChildItemCount = $aggregateChildItemCounts[$folder.EntryId]

$stats = $FolderData.StatisticsDictionary[$folder.EntryId]
[int]$itemCount = $stats.ItemCount
[Int64]$totalItemSize = $stats.TotalItemSize
if ($null -ne $stats) {
[int]$itemCount = $stats.ItemCount
[Int64]$totalItemSize = $stats.TotalItemSize
} else {
$noStatisticsResult = @{
TestName = "Limit"
Severity = "Warning"
ResultType = "NoStatistics"
FolderIdentity = $folder.Identity.ToString()
FolderEntryId = $folder.EntryId.ToString()
}
New-TestResult @noStatisticsResult
}

$parent = $FolderData.EntryIdDictionary[$folder.ParentEntryId]
if ($null -ne $parent) {
$aggregateChildItemCounts[$parent.EntryId] += $itemCount
if ($null -ne $aggregateChildItemCount) {
$aggregateChildItemCounts[$parent.EntryId] += $aggregateChildItemCount
}
}

if ($itemCount -lt 1 -and $aggregateChildItemCounts[$folder.EntryId] -lt 1 -and $folder.FolderPathDepth -gt 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function Write-TestFolderLimitResult {
$itemCountResults = New-Object System.Collections.ArrayList
$totalItemSizeResults = New-Object System.Collections.ArrayList
$emptyFolderResults = New-Object System.Collections.ArrayList
$noStatisticsResults = New-Object System.Collections.ArrayList
$hierarchyCountResult = $null
$hierarchyAndDumpsterCountResult = $null
$folderCountMigrationLimit = 250000
Expand All @@ -32,6 +33,7 @@ function Write-TestFolderLimitResult {
"TotalItemSize" { [void]$totalItemSizeResults.Add($TestResult) }
"HierarchyCount" { $hierarchyCountResult = $TestResult }
"HierarchyAndDumpsterCount" { $hierarchyAndDumpsterCountResult = $TestResult }
"NoStatistics" { [void]$noStatisticsResults.Add($TestResult) }
}
}
}
Expand Down Expand Up @@ -79,5 +81,11 @@ function Write-TestFolderLimitResult {
"Folders contain no items and have only empty subfolders. " +
"These will not cause a migration issue, but they may be pruned if desired.")
}

if ($noStatisticsResults.Count -gt 0) {
Get-ResultSummary -ResultType $noStatisticsResults[0].ResultType -Severity $noStatisticsResults[0].Severity -Count $noStatisticsResults.Count -Action (
"Public folder statistics could not be retreived for these folders. " +
"ItemCount, TotalItemSize, and EmptyFolder tests were skipped for these folders.")
}
}
}
1 change: 1 addition & 0 deletions docs/PublicFolders/SourceSideValidations.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Limit|FolderPathDepth|The folder path is greater than 299 folders deep.
Limit|HierarchyCount|There are more than 250,000 total folders in the hierarchy.
Limit|HierarchyAndDumpsterCount|There are more than 250,000 total folders if you count both the folders and their dumpsters.
Limit|ItemCount|The folder has more than 1,000,000 items.
Limit|NoStatistics|Get-PublicFolderStatistics did not return any statistics for these folders. ItemCount, TotalItemSize, and EmptyFolder tests were skipped.
Limit|TotalItemSize|The items directly in this folder (not child folders) add up to more than 25 GB.
MailEnabledFolder|MailDisabledWithProxyGuid|The folder is not mail-enabled, but it has the GUID of an Active Directory object in its MailRecipientGuid property.
MailEnabledFolder|MailEnabledSystemFolder|The folder is a system folder, which should not be mail-enabled.
Expand Down