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

MSFT_O365OrgSettings: invalid API urls for GCC High Tenent #3673

Closed
CraigHume opened this issue Sep 11, 2023 · 0 comments · Fixed by #3674 or #3682
Closed

MSFT_O365OrgSettings: invalid API urls for GCC High Tenent #3673

CraigHume opened this issue Sep 11, 2023 · 0 comments · Fixed by #3674 or #3682

Comments

@CraigHume
Copy link

CraigHume commented Sep 11, 2023

Details of the scenario you tried and the problem that is occurring

For GCC High Tenant, getting Bad Request error message for O365OrgSettings.

Verbose logs showing the problem

System.Net.WebException: The remote server returned an error: (400) Bad Request.
at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(WebRequest request)
at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord()
"Error during Export:"
at Connect-MSCloudLoginTasksWithCertificateThumbprint, C:\Program Files\WindowsPowerShell\Modules\MSCloudLoginAssistant\1.0.120\Workloads\Tasks.psm1: line 187
at Connect-MSCloudLoginTasks, C:\Program Files\WindowsPowerShell\Modules\MSCloudLoginAssistant\1.0.120\Workloads\Tasks.psm1: line 24
at Connect, C:\Program Files\WindowsPowerShell\Modules\MSCloudLoginAssistant\1.0.120\ConnectionProfile.psm1: line 560
at Connect-M365Tenant, C:\Program Files\WindowsPowerShell\Modules\MSCloudLoginAssistant\1.0.120\MSCloudLoginAssistant.psm1: line 335
at New-M365DSCConnection, C:\Program Files\WindowsPowerShell\Modules\Microsoft365dsc\1.23.906.1\modules\M365DSCUtil.psm1: line 1981
at Get-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365dsc\1.23.906.1\DSCResources\MSFT_O365OrgSettings\MSFT_O365OrgSettings.psm1: line 156
at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365dsc\1.23.906.1\DSCResources\MSFT_O365OrgSettings\MSFT_O365OrgSettings.psm1: line 1047
at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365dsc\1.23.906.1\modules\M365DSCReverse.psm1: line 615
at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365dsc\1.23.906.1\modules\M365DSCUtil.psm1: line 1310
at , : line 1

Suggested solution to the issue

This resource contains a lot of Invoke-MgGraphRequest lines, but the URLs apply to global / commercial tenants only. Fix would be to detect cloud type (or take a parameter specifying GCC high) and use the GCC / GCC high API endpoints for these invoke-mggraphrequest commands (i.e. .US rather than .COM)

The DSC configuration that is used to reproduce the issue (as detailed as possible)

Export-M365DSCConfiguration -Components @("O365OrgSettings") -Path ($rootpath + "\" + $workload) -FileName $file -GenerateInfo $true -Credential $cred

The operating system the target node is running

OsName : Microsoft Windows 11 Enterprise
OsOperatingSystemSKU : EnterpriseEdition
OsArchitecture : 64-bit
WindowsVersion : 2009
WindowsBuildLabEx : 22621.1.amd64fre.ni_release.220506-1250
OsLanguage : en-GB
OsMuiLanguages : {en-GB, en-US}

Version of the DSC module that was used ('dev' if using current dev branch)

NikCharlebois added a commit to NikCharlebois/Microsoft365DSC that referenced this issue Sep 11, 2023
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