From 2c150cf55037f4da6923ad4744752cc80e49d5bc Mon Sep 17 00:00:00 2001 From: Yorick Kuijs Date: Tue, 14 Jan 2025 13:41:11 +0100 Subject: [PATCH] Fixing issue #5625 --- CHANGELOG.md | 3 +++ .../MSFT_AADAuthenticationRequirement.psm1 | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bb1a2c4f4..d236c80740 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ # UNRELEASED +* AADAuthenticationRequirement + * Filtered guests from the export, to prevent errors during export + FIXES [#5625](https://github.com/microsoft/Microsoft365DSC/issues/5625) * AADGroupEligibilitySchedule * New resource for Privileged Identity Management (PIM) for Groups * AADNamingLocationPolicy diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationRequirement/MSFT_AADAuthenticationRequirement.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationRequirement/MSFT_AADAuthenticationRequirement.psm1 index e8e8fae959..c32a0c931c 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationRequirement/MSFT_AADAuthenticationRequirement.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationRequirement/MSFT_AADAuthenticationRequirement.psm1 @@ -310,7 +310,7 @@ function Export-TargetResource try { - [array]$getValue = Get-MgUser -ErrorAction Stop -All | Where-Object -FilterScript { $null -ne $_.Id } + [array]$getValue = Get-MgUser -Filter "userType eq 'member'" -All -ErrorAction Stop | Where-Object -FilterScript { $null -ne $_.Id } $i = 1 $dscContent = ''