From c7dcfc0246500653439fd3f4ba2c2857d0fc31ff Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Tue, 12 Nov 2024 09:01:06 -0500 Subject: [PATCH] TeamsUpgradePolicy - Performance Improvements --- CHANGELOG.md | 2 ++ .../MSFT_TeamsUpgradePolicy/MSFT_TeamsUpgradePolicy.psm1 | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) 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 {