You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the current version of M365DSC installed with PNP modules 2.12.0 and 1.12.0 installed. I registered and app, gave it consent and added it to SharePoint Online as a trusted app. I run the following command "Export-M365DSCConfiguration -Workloads OD -ApplicationId "hidden" -TenantId "hidden.onmicrosoft.com" -Components @("SPOAccessControlSettings") -Path C:\DSC -FileName OneDrive.ps1 -Credential $creds" to get an export of the OneDrive settings and the error I get is "System.InvalidOperationException: The current connection holds no SharePoint context. Please use one of the Connect-PnPOnline commands which uses the -Url argument to connect.
".
at PnP.PowerShell.Commands.PnPSharePointCmdlet.BeginProcessing()
at PnP.PowerShell.Commands.Base.PnPAdminCmdlet.BeginProcessing()
at System.Management.Automation.Cmdlet.DoBeginProcessing()
at System.Management.Automation.CommandProcessorBase.DoBegin()
"Error retrieving data:"
at Get-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.1002.1\DSCResources\MSFT_ODSettings\MSFT_ODSettings.psm1: line 128
at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.1002.1\DSCResources\MSFT_ODSettings\MSFT_ODSettings.psm1: line 669
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 1439
at , : line 1
Microsoft 365 DSC Version
1.24.1002.1
Which workloads are affected
OneDrive for Business
The DSC configuration
No response
Verbose logs showing the problem
2024/10/0808:27:18]
{NotSpecified}
System.InvalidOperationException: The current connection holds no SharePoint context. Please use one of the Connect-PnPOnline commands which uses the -Url argument to connect.
at PnP.PowerShell.Commands.PnPSharePointCmdlet.BeginProcessing()
at PnP.PowerShell.Commands.Base.PnPAdminCmdlet.BeginProcessing()
at System.Management.Automation.Cmdlet.DoBeginProcessing()
at System.Management.Automation.CommandProcessorBase.DoBegin()
"Error retrieving data:"
at Get-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.1002.1\DSCResources\MSFT_ODSettings\MSFT_ODSettings.psm1: line 128
at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.1002.1\DSCResources\MSFT_ODSettings\MSFT_ODSettings.psm1: line 669
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 1439
at <ScriptBlock>,<No file>: line 1
Environment Information + PowerShell Version
OsName : Microsoft Windows 10 Pro
OsOperatingSystemSKU : 48
OsArchitecture : 64-bit
WindowsVersion : 2009
WindowsBuildLabEx : 19041.1.amd64fre.vb_release.191206-1406
OsLanguage : en-US
OsMuiLanguages : {en-US}
PS C:\WINDOWS\system32>
PS C:\WINDOWS\system32>$PSVersionTable
Name Value
---------
PSVersion 5.1.19041.4894
PSEdition Desktop
PSCompatibleVersions {1.0,2.0,3.0,4.0...}
BuildVersion 10.0.19041.4894
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
The text was updated successfully, but these errors were encountered:
Description of the issue
I have the current version of M365DSC installed with PNP modules 2.12.0 and 1.12.0 installed. I registered and app, gave it consent and added it to SharePoint Online as a trusted app. I run the following command "Export-M365DSCConfiguration -Workloads OD -ApplicationId "hidden" -TenantId "hidden.onmicrosoft.com" -Components @("SPOAccessControlSettings") -Path C:\DSC -FileName OneDrive.ps1 -Credential $creds" to get an export of the OneDrive settings and the error I get is "System.InvalidOperationException: The current connection holds no SharePoint context. Please use one of the Connect-PnPOnline commands which uses the -Url argument to connect.
".
at PnP.PowerShell.Commands.PnPSharePointCmdlet.BeginProcessing()
at PnP.PowerShell.Commands.Base.PnPAdminCmdlet.BeginProcessing()
at System.Management.Automation.Cmdlet.DoBeginProcessing()
at System.Management.Automation.CommandProcessorBase.DoBegin()
"Error retrieving data:"
at Get-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.1002.1\DSCResources\MSFT_ODSettings\MSFT_ODSettings.psm1: line 128
at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.24.1002.1\DSCResources\MSFT_ODSettings\MSFT_ODSettings.psm1: line 669
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 1439
at , : line 1
Microsoft 365 DSC Version
1.24.1002.1
Which workloads are affected
OneDrive for Business
The DSC configuration
No response
Verbose logs showing the problem
Environment Information + PowerShell Version
The text was updated successfully, but these errors were encountered: