O365ORgSettings 500 Internal error
Description of the issue
When attempting to export the O365OrgSettings component using App-only (Certificate) authentication, the process fails with a 500 Internal Server Error specifically during the Get-M365DSCOrgSettingsToDo extraction step. The pipeline retries multiple times but ultimately fails and aborts the export of the component.
All required Graph API Application permissions (including OrgSettings-Todo.Read.All and Tasks.Read.All) are granted and admin-consented. I also attempted the common workaround of manually visiting the To Do settings in the M365 Admin Center to force background initialization, but the 500 error persists.
Microsoft 365 DSC Version
1.26.422.1
Which workloads are affected
Office 365 Admin
The DSC configuration
Verbose logs showing the problem
[2026/04/29 07:07:34]
{InvalidOperation}
Microsoft.Graph.PowerShell.Authentication.Helpers.HttpResponseException: Response status code does not indicate success: InternalServerError (Internal Server Error).
at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord)
"Error retrieving O365OrgSettings To Do Settings"
at Get-M365DSCOrgSettingsToDo, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.26.422.1\DSCResources\MSFT_O365OrgSettings\MSFT_O365OrgSettings.psm1: line 1442
at <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.26.422.1\DSCResources\MSFT_O365OrgSettings\MSFT_O365OrgSettings.psm1: line 403
at Invoke-M365DSCCommand, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.26.422.1\Modules\M365DSCErrorHandler.psm1: line 315
at Get-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.26.422.1\DSCResources\MSFT_O365OrgSettings\MSFT_O365OrgSettings.psm1: line 403
at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.26.422.1\DSCResources\MSFT_O365OrgSettings\MSFT_O365OrgSettings.psm1: line 1122
at <ScriptBlock>, <No file>: line 97
at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.26.422.1\Modules\M365DSCReverse.psm1: line 810
at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.26.422.1\Modules\M365DSCExportUtil.psm1: line 383
Environment Information + PowerShell Version
@gaborenok Is that issue appearing consistently or only intermittently? I have a daily export pipeline running and didn't (maybe yet) suffer from this issue.
Can confirm I've seen a clear uptick in 500 internal server errors over the last week especially, but really as early as the last month too.
Not specific to any endpoint it seems as I've seen it with apps as well as managedDevices, and we're also seeing it with non-m365dsc jobs that hit graph directly.
Seems to be a clear backend service issue.
Thank you @nkasco. We have some backoff mechanics in place for some resources that are frequently getting 500 errors, but at one point we have to continue and/or abort. If it's something happening a lot more frequently, then we can't do anything about it. We're still at mercy of the backend.
Right agreed we just need backend service stability. I'd expect it to be our problem to account for 429 throttles but beyond that it shouldn't be a consumer problem to solve
Indeed. 429 is client side as indicated by 4xx, but 5xx is always backend. I'll try to leverage my connections to Microsoft for some heads up and investigative measures. Can't promise anything though.
Yes, this is a constant issue for me, I haven't managed to export O365OrgSettings with the latest DSC for none of my tenants. I commented out ToDo in the module for now, and that solves it for now.
I also reported this in to my contacts as well, got a response back later yesterday and I think we should see some improvement soon. I haven't received a full report so I'm not sure if it's a per-endpoint issue or not. A hotfix went in for 1 of them and another on the way.
As far as M365DSC, we'll just want to ensure there aren't any uncaught errors lurking that need patched up.
On my side, I still have the ToDo endpoint issue on 2 test tenants as mentioned in https://github.com/Microsoft365DSC/Microsoft365DSC/issues/6868 I'm curious to know in which region is your tenant hosted, as other people could not reproduce.
One problem is that the previous version of M365DSC used to output an error but still output a partial O365OrgSettings object whereas the newer versions (422 and up AFAIK) completely omit the object. Neither solution is satisfactory and I would submit the idea to have separate objects for the separate areas the O365OrgSettings various properties cover.
Did the situation improve in the meantime? I didn't encounter issues with the endpoint anymore.
Hello, yes, it works now, thanks!
FWIW my understanding is that the recently applied fixes are per-endpoint. There is some shared architecture, though.
Thanks for confirming that it works now. We will keep monitoring the situation but close the issue for now.