Microsoft365DSC icon indicating copy to clipboard operation
Microsoft365DSC copied to clipboard

IntuneDeviceEnrollmentStatusPageWindows10.Set-TargetResource has hard coded Commercial Graph endpoints breaking Government

Open mpoulson opened this issue 4 months ago • 0 comments

Description of the issue

IntuneDeviceEnrollmentStatusPageWindows10.Set-TargetResource call to Invoke-MgGraphRequest use a hard coded graph.microsoft.com endpoint which results in failure with EntraID Government tenants.

Correct call should use $Global:MSCloudLoginConnectionProfile.MicrosoftGraph.ResourceUrl for the graph hostname.

$Uri = $Global:MSCloudLoginConnectionProfile.MicrosoftGraph.ResourceUrl + "beta/deviceManagement/deviceEnrollmentConfigurations/$($policy.Id)/assign" $Uri = $Global:MSCloudLoginConnectionProfile.MicrosoftGraph.ResourceUrl + "beta/deviceManagement/deviceEnrollmentConfigurations/$($currentInstance.Id)/assign" $Uri = $Global:MSCloudLoginConnectionProfile.MicrosoftGraph.ResourceUrl + "beta/deviceManagement/deviceEnrollmentConfigurations/$DeviceEnrollmentConfigurationId/setpriority"

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

Intune

The DSC configuration

No response

Verbose logs showing the problem

No response

Environment Information + PowerShell Version

No response

mpoulson avatar Oct 21 '24 00:10 mpoulson