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

O365: Error while exporting O365ExternalConnection and O365OrgSettings #5156

Open
dominicbuehrer opened this issue Oct 7, 2024 · 0 comments

Comments

@dominicbuehrer
Copy link

dominicbuehrer commented Oct 7, 2024

Description of the issue

Failing while I try to export the O365 config.

[2/4] Extracting [O365ExternalConnection] using {CertificateThumbprint}...
|---[1/2] LearningAppConnectorV8 Error Log created at {file://C:/Windows/system32/11436-M365DSC-ErrorLog.log}✅
|---[2/2] AzureDevOps1 Error Log created at {file://C:/Windows/system32/11436-M365DSC-ErrorLog.log}✅
[4/4] Extracting [O365OrgSettings] using {CertificateThumbprint}...Error Log created at {file://C:/Windows/system32/11436-M365DSC-ErrorLog.log}❌

For the external connection's, it can not find the referenced application. Where is this configured?

For the org setting, the following permissions are granted to the app
image

Microsoft 365 DSC Version

1.24.1002.1

Which workloads are affected

Office 365 Admin

The DSC configuration

$WriteOutput = Export-M365DSCConfiguration `
  -Components @("O365AdminAuditLogConfig","O365OrgCustomizationSetting","O365OrgSettings","O365SearchAndIntelligenceConfigurations","O365ExternalConnection") `
  -Path ("$LogPath\$Workload") `
  -FileName ("$($Workload)_$($Mode)_ConfigurationData.ps1") `
  -ConfigurationName ("$($Workload)_$($Mode)_ConfigurationData.psd1") `
  -ApplicationId $ApplicationId `
  -TenantId $TenantId `
  -CertificateThumbprint $CertificateThumbprint

Verbose logs showing the problem

[2024.10.07 01:33:08]
{OperationStopped}
System.Management.Automation.RuntimeException: Could not find referenced application {2c9e12e5-a56c-4ba1-b768-7a141586c6fe} in the tenant.
"Error retrieving data:"
at Get-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.1002.1\DSCResources\MSFT_O365ExternalConnection\MSFT_O365ExternalConnection.psm1: line 110
at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.1002.1\DSCResources\MSFT_O365ExternalConnection\MSFT_O365ExternalConnection.psm1: line 418
at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.1002.1\Modules\M365DSCReverse.psm1: line 682
at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.1002.1\Modules\M365DSCUtil.psm1: line 1460
at <ScriptBlock>, D:\Microsoft365DSC.ps1: line 384
TenantId: *.onmicrosoft.com



[2024.10.07 01:33:11]
{OperationStopped}
System.Management.Automation.RuntimeException: Could not find referenced application {56c1da01-2129-48f7-9355-af6d59d42766} in the tenant.
"Error retrieving data:"
at Get-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.1002.1\DSCResources\MSFT_O365ExternalConnection\MSFT_O365ExternalConnection.psm1: line 110
at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.1002.1\DSCResources\MSFT_O365ExternalConnection\MSFT_O365ExternalConnection.psm1: line 418
at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.1002.1\Modules\M365DSCReverse.psm1: line 682
at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.1002.1\Modules\M365DSCUtil.psm1: line 1460
at <ScriptBlock>, D:\Microsoft365DSC.ps1: line 384
TenantId: *.onmicrosoft.com



[2024.10.07 01:33: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`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.Analytics.GetDefaultTenantMyAnalyticsFeatureConfig.InternalProcessRecord()
   at Microsoft.Exchange.Management.RestApiClient.AdminCmdlet`2.<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.24.1002.1\DSCResources\MSFT_O365OrgSettings\MSFT_O365OrgSettings.psm1: line 294
at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.1002.1\DSCResources\MSFT_O365OrgSettings\MSFT_O365OrgSettings.psm1: line 1102
at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.1002.1\Modules\M365DSCReverse.psm1: line 682
at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.1002.1\Modules\M365DSCUtil.psm1: line 1460
at <ScriptBlock>, D:\Microsoft365DSC.ps1: line 384
TenantId: *.onmicrosoft.com



[2024.10.07 01:33:25]
{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)
   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.24.1002.1\Modules\M365DSCUtil.psm1: line 3915
at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.1002.1\DSCResources\MSFT_O365OrgSettings\MSFT_O365OrgSettings.psm1: line 1107
at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.1002.1\Modules\M365DSCReverse.psm1: line 682
at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.1002.1\Modules\M365DSCUtil.psm1: line 1460
at <ScriptBlock>, D:\Microsoft365DSC.ps1: line 384
TenantId: *.onmicrosoft.com

Environment Information + PowerShell Version

Name                           Value                                                                                                                                                                                    
----                           -----                                                                                                                                                                                    
PSVersion                      5.1.14393.7330                                                                                                                                                                           
PSEdition                      Desktop                                                                                                                                                                                  
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                                  
BuildVersion                   10.0.14393.7330                                                                                                                                                                          
CLRVersion                     4.0.30319.42000                                                                                                                                                                          
WSManStackVersion              3.0                                                                                                                                                                                      
PSRemotingProtocolVersion      2.3                                                                                                                                                                                      
SerializationVersion           1.1.0.1
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

No branches or pull requests

1 participant