From 3780ba8fb48c444cc12444ad24a49e5d733741e0 Mon Sep 17 00:00:00 2001 From: Bill Long Date: Tue, 13 Apr 2021 07:52:49 -0700 Subject: [PATCH] Explicitly pass EntryId to decrease time by about 30% --- .../src/SourceSideValidations/Get-BadMailEnabledFolder.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PublicFolders/src/SourceSideValidations/Get-BadMailEnabledFolder.ps1 b/PublicFolders/src/SourceSideValidations/Get-BadMailEnabledFolder.ps1 index dd0047b43e..4f7c42f072 100644 --- a/PublicFolders/src/SourceSideValidations/Get-BadMailEnabledFolder.ps1 +++ b/PublicFolders/src/SourceSideValidations/Get-BadMailEnabledFolder.ps1 @@ -37,7 +37,7 @@ $estimatedRemaining = [TimeSpan]::FromTicks($ipmSubtreeMailEnabled.Count / $progressCount * $elapsed.Ticks - $elapsed.Ticks).ToString("hh\:mm\:ss") Write-Progress @progressParams -PercentComplete ($i * 100 / $ipmSubtreeMailEnabled.Count) -Status ("$i of $($ipmSubtreeMailEnabled.Count) Estimated time remaining: $estimatedRemaining") } - $result = $ipmSubtreeMailEnabled[$i] | Get-MailPublicFolder -ErrorAction SilentlyContinue + $result = Get-MailPublicFolder $ipmSubtreeMailEnabled[$i].EntryId -ErrorAction SilentlyContinue if ($null -eq $result) { $mailEnabledFoldersWithNoADObject += $ipmSubtreeMailEnabled[$i] } else {