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

Unable to Export the Office 365 Org Settings ResourceName : O365OrgSettings #5457

Open
pdrive29 opened this issue Nov 23, 2024 · 0 comments
Open

Comments

@pdrive29
Copy link

Description of the issue

Hello Hope Everyone is doing well, I am trying to export the Office 365 Admin Centre Org Settings Export I was able to successfully export it once after providing the correct Graph API permissions to my App registrations, but after that one successful export without doing any change when I tried to run the export again but it is failing

From the Error Logs it indicates that it needs to connect to the Exchange-Online
Even connecting directly with the Exchange Online using the Connect-ExchangeOnline didn't work

[2024/11/10 08:25:06]
{ProtocolError}
Microsoft.Exchange.Management.RestApiClient.RestClientException: You must call Connect-ExchangeOnline before calling any other cmdlet.
at Microsoft.Exchange.Management.RestApiClient.AdminCmdlet2.get_AuthProvider() at Microsoft.Exchange.Management.RestApiClient.AdminCmdlet2.b__34_1()
at Microsoft.Online.CSE.RestApiPowerShellModule.Instrumentation.Activity.LogLatencyIfExceedingThreshold[T](String stageName, Func1 func, UInt64 threshold) at Microsoft.Exchange.Management.RestApiClient.AdminCmdlet2.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 ,
TenantId:

[2024/11/10 08:25:11]
{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.ActionCallInstruction2.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(Action1 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
TenantId:

It also mentioned to run the update of the module but after running the update now I am getting this error message

Image

Microsoft 365 DSC Version

DEV 1.24.1002.1

Which workloads are affected

Office 365 Admin, Exchange Online

The DSC configuration

Export-M365DSCConfiguration -ApplicationId $ClientID -TenantId $TenantID -ApplicationSecret $Appsecret -Components @("O365OrgSettings")

Verbose logs showing the problem

[2024/11/10 08:25:06]
{ProtocolError}
Microsoft.Exchange.Management.RestApiClient.RestClientException: You must call Connect-ExchangeOnline before calling any other cmdlet.
   at Microsoft.Exchange.Management.RestApiClient.AdminCmdlet`2.get_AuthProvider()
   at Microsoft.Exchange.Management.RestApiClient.AdminCmdlet`2.<ProcessRecord>b__34_1()
   at Microsoft.Online.CSE.RestApiPowerShellModule.Instrumentation.Activity.LogLatencyIfExceedingThreshold[T](String stageName, Func`1 func, UInt64 threshold)
   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>, 
TenantId: 



[2024/11/10 08:25:11]
{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>
TenantId:

Environment Information + PowerShell Version

OsName               : Microsoft Windows 11 Pro
OsOperatingSystemSKU : 48
OsArchitecture       : 64-bit
WindowsVersion       : 2009
WindowsBuildLabEx    : 22621.1.amd64fre.ni_release.220506-1250
OsLanguage           : en-US
OsMuiLanguages       : {en-US}


Name                           Value
----                           -----
PSVersion                      5.1.22621.4391
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.4391
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