microsoft / Microsoft365DSC

Manages, configures, extracts and monitors Microsoft 365 tenant configurations
https://aka.ms/M365DSC
MIT License
1.62k stars 501 forks source link

[AADRoleSettings] Code does not process ActivateApprover parameter correctly when the approver does not exist #5423

Open ykuijs opened 2 hours ago

ykuijs commented 2 hours ago

Description of the issue

The code relies on a try/catch when looking for the provided approvers to detect when the approver does not exist. However when using the filter parameter of Get-MgUser/Get-MgGroup, an exception is never thrown.

This code has to be changed to check for $null instead.

Microsoft 365 DSC Version

Dev

Which workloads are affected

Azure Active Directory (Entra ID)

The DSC configuration

Verbose logs showing the problem

Environment Information + PowerShell Version

ykuijs commented 2 hours ago

Working on it