Microsoft365DSC icon indicating copy to clipboard operation
Microsoft365DSC copied to clipboard

AADGroup Get-TargetResource Get Assigned Licenses doesn't work with Government .us endpoints

Open mpoulson opened this issue 4 months ago • 0 comments

Description of the issue

AADGroup.Get-TargetResource call to Invoke-MgGraphRequest use a hard coded graph.microsoft.com endpoint (line 272) which results in failure with EntraID Government tenants.

Correct call should be to do $url = $Global:MSCloudLoginConnectionProfile.MicrosoftGraph.ResourceUrl + "v1.0/groups/$($Group.Id)/assignedLicenses"

FYI: All calls to graph.microsoft.com need to be replaced with a cloud specific endpoint and Devs need to stop hard coding graph.microsoft.com

Microsoft 365 DSC Version

1.24.1016.1

Which workloads are affected

Azure Active Directory (Entra ID)

The DSC configuration

Export-M365DSCConfiguration -Credential $creds -tenantID .onmicrosoft.us -Component @("AADGroup")

Verbose logs showing the problem

No response

Environment Information + PowerShell Version

No response

mpoulson avatar Oct 20 '24 01:10 mpoulson