diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c5c7d350b..e34ab75c46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ * M365DSCIntuneSettingsCatalogUtil * Add ADMX handling for `edge~httpauthentication_`. FIXES [#5378](https://github.com/microsoft/Microsoft365DSC/issues/5378) (2/2) +* TeamsUpgradePolicy + * Changes to how we're retrieving the users to improve performance. * DEPENDENCIES * Updated DSCParser to version 2.0.0.12. diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUpgradePolicy/MSFT_TeamsUpgradePolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUpgradePolicy/MSFT_TeamsUpgradePolicy.psm1 index 20ecfd0716..e845b47cb9 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUpgradePolicy/MSFT_TeamsUpgradePolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUpgradePolicy/MSFT_TeamsUpgradePolicy.psm1 @@ -68,13 +68,13 @@ function Get-TargetResource if ($Identity -eq 'Global') { - [array]$users = Get-CsOnlineUser | Where-Object -Filter { $_.TeamsUpgradePolicy -eq $null } + [array]$users = Get-CsOnlineUser -Filter "TeamsUpgradePolicy eq null" } else { try { - [array]$users = Get-CsOnlineUser -Filter "TeamsUpgradePolicy -eq '$Identity'" + [array]$users = Get-CsOnlineUser -Filter "TeamsUpgradePolicy eq '$Identity'" } catch {