Closed jonathanhotono closed 1 year ago
Based on the official Exchange Online PowerShell module’s documentation, you will need to assign one of the Azure AD supported roles below to your app in order to be able to using via app-only auth:
Thanks
@NikCharlebois The app was initially already assigned Global reader role and it shows that error. Then I tried to assign Global Admin role with full 'Update' api permission, and it stills showing the same error message. Any thoughts?
@jonathanhotono If I assign Exchange Administrator to the app, it runs without an error on my side.
@jonathanhotono as mentioned above, it needs one of the official EXO Manage as app role. EXO Admin being one. I will be closing this for the moment. If you are still facing the issue after assigning a valid role, please let me know. Thanks
@NikCharlebois So I too am having same exact issue: what is odd is this: on 15-feb 2024 exporting the O365OrgSettings worked like a champ, starting this week after returning from vacation, it errors out with same error as above
Microsoft.Exchange.Management.RestApiClient.RestClientException: The following authorization requirements are not satisfied:
API Perms needed per Get-M365DSCCompiledPermissionList
Get-M365DSCCompiledPermissionList -ResourceNameList @("O365AdminAuditLogConfig", "O365OrgCustomizationSetting", "O365OrgSettings", "O365SearchAndIntelligenceConfigurations") -PermissionType Application -AccessType Read
Name Value
API Perms assigned to the App Registration
Roles Assigned to App Registration: Exchange Administrator
Version of DSC Tool installed: 1.24.228.1 Microsoft365DSC
Any suggestions ?
Based on the official Exchange Online PowerShell module’s documentation, you will need to assign one of the Azure AD supported roles below to your app in order to be able to using via app-only auth:
Thanks
What permissions are able to be assigned for a pull resources only? I see a few generic links to MS, however, I cannot find M365DSC's documentation on what is required for example if I want to ReadOnly all EXO* resources.
Description of the issue
Tried executing:
Export-M365DSCConfiguration -Components @("O365OrgSettings", "O365SearchAndIntelligenceConfigurations") -ApplicationId $ApplicationId -CertificateThumbprint $CertificateThumbprint -TenantId $TenantId
With all READ permission set as per settings.json:
https://raw.githubusercontent.com/microsoft/Microsoft365DSC/Dev/Modules/Microsoft365DSC/DSCResources/MSFT_O365OrgSettings/settings.json
Not sure why Tasks needs to have ReadWrite but I followed the json. The rest of the export report feature works.
Microsoft 365 DSC Version
1.23.823.1
Which workloads are affected
Office 365 Admin
The DSC configuration
Export-M365DSCConfiguration -Components @("O365OrgSettings", "O365SearchAndIntelligenceConfigurations") -ApplicationId $ApplicationId -CertificateThumbprint $CertificateThumbprint -TenantId $TenantId
Verbose logs showing the problem
[2023/08/29 07:13:45] {ProtocolError} Microsoft.Exchange.Management.RestApiClient.RestClientException: The following authorization requirements are not satisfied: ((TokenTypeAuthorizationRequirement(UserActAs, AppOnly)&ScopeAuthorizationRequirement(OrganizationSettings.Read, OrganizationSettings.ReadWrite, OrganizationSettings.Read, OrganizationSettings.ReadWrite))|WidsAuthorizationRequirement(62e90394-69f5-4237-9190-012177145e10,29232cdf-9323-42fd-ade2-1d097af3e4de,69091246-20e8-4a56-aa4d-066075b2a7a8,eb1f4a8d-243a-41f0-9fbd-c7cdf6c5ef7c)). at Microsoft.Exchange.Management.RestApiClient.M365Insights.WeveAdminCmdlet, : line 1
TenantId: ##.onmicrosoft.com
2.HandleErrorResponse(HttpResponseMessage response, String settingsName) at Microsoft.Exchange.Management.RestApiClient.M365Insights.WeveAdminCmdlet
2.MakeAndSendGetRequest[T](String settingsName, Uri uri) at Microsoft.Exchange.Management.RestApiClient.Briefing.GetDefaultTenantBriefingConfig.InternalProcessRecord() at Microsoft.Exchange.Management.RestApiClient.AdminCmdlet2.<ProcessRecord>b__34_0() at Microsoft.Exchange.Management.RestApiClient.AdminCmdlet
2.ExecuteWithExceptionHandling(Action action, Exception& exception) "Error retrieving data:" at Get-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.823.1\DSCResources\MSFT_O365OrgSettings\MSFT_O365OrgSettings.psm1: line 230 at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.823.1\DSCResources\MSFT_O365OrgSettings\MSFT_O365OrgSettings.psm1: line 1047 at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.823.1\modules\M365DSCReverse.psm1: line 615 at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.823.1\modules\M365DSCUtil.psm1: line 1310 at[2023/08/29 07:13:46] {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, : line 1
TenantId: ##.onmicrosoft.com
2.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0) at System.Management.Automation.PSScriptCmdlet.RunClause(Action
1 clause, Object dollarUnderbar, Object inputToProcess) at System.Management.Automation.PSScriptCmdlet.DoEndProcessing() at System.Management.Automation.CommandProcessorBase.Complete() "Error during Export:" at Get-M365DSCExportContentForResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.823.1\modules\M365DSCUtil.psm1: line 3296 at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.823.1\DSCResources\MSFT_O365OrgSettings\MSFT_O365OrgSettings.psm1: line 1052 at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.823.1\modules\M365DSCReverse.psm1: line 615 at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.823.1\modules\M365DSCUtil.psm1: line 1310 at[2023/08/29 07:14:48] {ProtocolError} Microsoft.Exchange.Management.RestApiClient.RestClientException: The following authorization requirements are not satisfied: ((TokenTypeAuthorizationRequirement(UserActAs, AppOnly)&ScopeAuthorizationRequirement(OrganizationSettings.Read, OrganizationSettings.ReadWrite, OrganizationSettings.Read, OrganizationSettings.ReadWrite))|WidsAuthorizationRequirement(62e90394-69f5-4237-9190-012177145e10,29232cdf-9323-42fd-ade2-1d097af3e4de,69091246-20e8-4a56-aa4d-066075b2a7a8,eb1f4a8d-243a-41f0-9fbd-c7cdf6c5ef7c)). at Microsoft.Exchange.Management.RestApiClient.M365Insights.WeveAdminCmdlet, : line 1
TenantId: ##.onmicrosoft.com
2.HandleErrorResponse(HttpResponseMessage response, String settingsName) at Microsoft.Exchange.Management.RestApiClient.M365Insights.WeveAdminCmdlet
2.MakeAndSendGetRequest[T](String settingsName, Uri uri) at Microsoft.Exchange.Management.RestApiClient.Briefing.GetDefaultTenantBriefingConfig.InternalProcessRecord() at Microsoft.Exchange.Management.RestApiClient.AdminCmdlet2.<ProcessRecord>b__34_0() at Microsoft.Exchange.Management.RestApiClient.AdminCmdlet
2.ExecuteWithExceptionHandling(Action action, Exception& exception) "Error retrieving data:" at Get-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.823.1\DSCResources\MSFT_O365OrgSettings\MSFT_O365OrgSettings.psm1: line 230 at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.823.1\DSCResources\MSFT_O365OrgSettings\MSFT_O365OrgSettings.psm1: line 1047 at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.823.1\modules\M365DSCReverse.psm1: line 615 at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.823.1\modules\M365DSCUtil.psm1: line 1310 at[2023/08/29 07:14:49] {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, : line 1
TenantId: ##.onmicrosoft.com
2.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0) at System.Management.Automation.PSScriptCmdlet.RunClause(Action
1 clause, Object dollarUnderbar, Object inputToProcess) at System.Management.Automation.PSScriptCmdlet.DoEndProcessing() at System.Management.Automation.CommandProcessorBase.Complete() "Error during Export:" at Get-M365DSCExportContentForResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.823.1\modules\M365DSCUtil.psm1: line 3296 at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.823.1\DSCResources\MSFT_O365OrgSettings\MSFT_O365OrgSettings.psm1: line 1052 at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.823.1\modules\M365DSCReverse.psm1: line 615 at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.823.1\modules\M365DSCUtil.psm1: line 1310 at[2023/08/29 07:27:23] {ProtocolError} Microsoft.Exchange.Management.RestApiClient.RestClientException: The following authorization requirements are not satisfied: ((TokenTypeAuthorizationRequirement(UserActAs, AppOnly)&ScopeAuthorizationRequirement(OrganizationSettings.Read, OrganizationSettings.ReadWrite, OrganizationSettings.Read, OrganizationSettings.ReadWrite))|WidsAuthorizationRequirement(62e90394-69f5-4237-9190-012177145e10,29232cdf-9323-42fd-ade2-1d097af3e4de,69091246-20e8-4a56-aa4d-066075b2a7a8,eb1f4a8d-243a-41f0-9fbd-c7cdf6c5ef7c)). at Microsoft.Exchange.Management.RestApiClient.M365Insights.WeveAdminCmdlet, : line 1
TenantId: ##.onmicrosoft.com
2.HandleErrorResponse(HttpResponseMessage response, String settingsName) at Microsoft.Exchange.Management.RestApiClient.M365Insights.WeveAdminCmdlet
2.MakeAndSendGetRequest[T](String settingsName, Uri uri) at Microsoft.Exchange.Management.RestApiClient.Briefing.GetDefaultTenantBriefingConfig.InternalProcessRecord() at Microsoft.Exchange.Management.RestApiClient.AdminCmdlet2.<ProcessRecord>b__34_0() at Microsoft.Exchange.Management.RestApiClient.AdminCmdlet
2.ExecuteWithExceptionHandling(Action action, Exception& exception) "Error retrieving data:" at Get-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.823.1\DSCResources\MSFT_O365OrgSettings\MSFT_O365OrgSettings.psm1: line 230 at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.823.1\DSCResources\MSFT_O365OrgSettings\MSFT_O365OrgSettings.psm1: line 1047 at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.823.1\modules\M365DSCReverse.psm1: line 615 at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.823.1\modules\M365DSCUtil.psm1: line 1310 at[2023/08/29 07:27:24] {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, : line 1
TenantId: ##.onmicrosoft.com
2.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0) at System.Management.Automation.PSScriptCmdlet.RunClause(Action
1 clause, Object dollarUnderbar, Object inputToProcess) at System.Management.Automation.PSScriptCmdlet.DoEndProcessing() at System.Management.Automation.CommandProcessorBase.Complete() "Error during Export:" at Get-M365DSCExportContentForResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.823.1\modules\M365DSCUtil.psm1: line 3296 at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.823.1\DSCResources\MSFT_O365OrgSettings\MSFT_O365OrgSettings.psm1: line 1052 at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.823.1\modules\M365DSCReverse.psm1: line 615 at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.823.1\modules\M365DSCUtil.psm1: line 1310 atEnvironment Information + PowerShell Version