Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AADConditionalAccess expects Terms of Use to post as Array of TermsofUse id not single ID #5742

Closed
mpoulson opened this issue Feb 7, 2025 · 0 comments · Fixed by #5772 or #5845
Closed

Comments

@mpoulson
Copy link
Contributor

mpoulson commented Feb 7, 2025

Description of the issue

Within GCC-High (have not confirmed on commercial) adding terms of Use Conditional Access Policy fails because the ID isn't in an array.

In file Modules/Microsoft365DSC/DSCResources/MSFT_AADConditionalAccessPolicy/MSFT_AADConditionalAccessPolicy.psm1

if ($TermsOfUse)
            {
                Write-Verbose -Message "Gettign Terms of Use {$TermsOfUse}"
                $TermsOfUseObj = Get-MgBetaAgreement | Where-Object -FilterScript { $_.DisplayName -eq $TermsOfUse }
                $GrantControls.Add('termsOfUse', $TermsOfUseObj.Id)
            }

Should be

if ($TermsOfUse)
            {
                Write-Verbose -Message "Gettign Terms of Use {$TermsOfUse}"
                $TermsOfUseObj = Get-MgBetaAgreement | Where-Object -FilterScript { $_.DisplayName -eq $TermsOfUse }
                $GrantControls.Add('termsOfUse', @($TermsOfUseObj.Id))
            }

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

@FabienTschanz FabienTschanz marked this as a duplicate of #4774 Feb 14, 2025
NikCharlebois added a commit that referenced this issue Feb 26, 2025
Fix #5742: Ensure TermsOfUse is an array in AADConditionalAccessPolicy
@NikCharlebois NikCharlebois mentioned this issue Feb 26, 2025
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant