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

Open
mpoulson opened this issue Feb 7, 2025 · 0 comments · May be fixed by #5772
Open

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

mpoulson opened this issue Feb 7, 2025 · 0 comments · May be fixed by #5772

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

Pranaykarvi added a commit to Pranaykarvi/Microsoft365DSC that referenced this issue Feb 14, 2025
@FabienTschanz FabienTschanz marked this as a duplicate of #4774 Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant