Microsoft365DSC icon indicating copy to clipboard operation
Microsoft365DSC copied to clipboard

O365OrgSettings issue with V1.24.626.1

Open YenNantes opened this issue 7 months ago • 2 comments

Description of the issue

I get an error when trying to export the O365Orgsettings resource since I upgraded to V1.24.626.1 It was working with the previous versions.

I'm using cert thumbprint with the delegated permisions mentionned on the doc: Application.ReadWrite.All, ReportSettings.Read.All, OrgSettings-Microsoft365Install.Read.All, OrgSettings-Forms.Read.All, OrgSettings-Todo.Read.All, OrgSettings-AppsAndServices.Read.All, OrgSettings-DynamicsVoice.Read.All, Tasks.Read.All

Additionally I would like to know why the doc says that "Application.ReadWrite.All" is required even in read-only mode.

Microsoft 365 DSC Version

1.24.626.1

Which workloads are affected

Office 365 Admin

The DSC configuration

Export-M365DSCConfiguration -Components O365Orgsettings -CertificateThumbprint xxxxx -ApplicationId xxxx -TenantId xxxxx.onmicrosoft.com

Verbose logs showing the problem

[2024/06/27 06:33:22]
{InvalidOperation}
System.Exception: [Authorization_RequestDenied] : Insufficient privileges to complete the operation.
"Error retrieving data:"
at New-MgServicePrincipal<Process>, C:\Program Files\WindowsPowerShell\Modules\Microsoft.Graph.Applications\2.19.0\exports\ProxyCmdletDefinitions.ps1: line 46027
at Get-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.626.1\DSCResources\MSFT_O365OrgSettings\MSFT_O365OrgSettings.psm1: line 208
at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.626.1\DSCResources\MSFT_O365OrgSettings\MSFT_O365OrgSettings.psm1: line 1079
at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.626.1\Modules\M365DSCReverse.psm1: line 682
at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.626.1\Modules\M365DSCUtil.psm1: line 1389
at <ScriptBlock>, <No file>: line 1
TenantId: xxxxxxx.onmicrosoft.com

Environment Information + PowerShell Version

No response

YenNantes avatar Jun 27 '24 13:06 YenNantes