Open gitbpotalan opened 5 months ago
Having the exact same issue with DSC version 1.24.403.1. In my case, I'm working to extract entire SPO workload with Default mode. The issue started a couple of weeks ago, the last successful export we had for SPO workload was April 1st then we start noticing this issue.
I updated all dependencies and removed the old ones too to no avail. Surprisingly, its only failing when extracting SPO workload and still works fine with other workloads such as EXO and Teams.
Main issues we noticed before the script fail prematurely are:
Error logs from today's export attempt:
[2024/04/16 09:12:38] {InvalidOperation} System.Management.Automation.RuntimeException: You cannot call a method on a null-valued expression. at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception) at System.Management.Automation.Interpreter.ActionCallInstruction
2.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
"Error during Export:"
at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.403.1\DSCResources\MSFT_SPOApp\MSFT_SPOApp.psm1: line 395
at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.403.1\Modules\M365DSCReverse.psm1: line 649
at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.403.1\Modules\M365DSCUtil.psm1: line 1349
at
@andikrueger is this something you can help with?
Workaround Solution: I had to disable the error handling CmdLets under the "M365DSCReverse.psm1" file to allow the script to continue to run without interruption!
Still have to deal with why I'm getting access denied when exporting the "Get-MgAdminSharepointSetting" despite having the API permission "Organization.Read.All" in my service principal!
Description of the issue
Workload SPO backup seems to progress versus SPO component fail to backup and shutdown the backup process when exception occurs I just want the process to keep going even if it encounters an error
I tried Export-M365DSCConfiguration -ErrorAction Continue and even -ErrorActionPreference Continue at the beginning of the script but nothing works
Microsoft 365 DSC Version
1.24.403.1
Which workloads are affected
SharePoint Online
The DSC configuration
Verbose logs showing the problem
Environment Information + PowerShell Version