pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets
https://pnp.github.io/powershell
Other
987 stars 665 forks source link

Add-PnPFile : Access denied. You do not have permission to perform this action or access this resource #2781

Closed liridonuka closed 4 years ago

liridonuka commented 4 years ago

Notice: many issues / bugs reported are actually related to the PnP Core Library which is used behind the scenes. Consider carefully where to report an issue:

  1. Are you using Apply-PnPProvisioningTemplate or Get-PnPProvisioningTemplate? The issue is most likely related to the Provisioning Engine. The Provisioning engine is not located in the PowerShell repo. Please report the issue here: https://github.com/pnp/PnP-Sites-Core/issues.
  2. Is the issue related to the cmdlet itself, its parameters, the syntax, or do you suspect it is the code of the cmdlet that is causing the issue? Then please continue reporting the issue in this repo.
  3. If you think that the functionality might be related to the underlying libraries that the cmdlet is calling (We realize that might be difficult to determine), please first double check the code of the cmdlet, which can be found here: https://github.com/pnp/PnP-PowerShell/tree/master/Commands. If related to the cmdlet, continue reporting the issue here, otherwise report the issue at https://github.com/pnp/PnP-Sites-Core/issues

Reporting an Issue or Missing Feature

Issue while trying to upload file to SharePoint Document Library. This is happening when Granting access using SharePoint App-Only and connecting with AppId and AppSecret.

Expected behavior

Adding file to Document Library. For instance I can add items to list or even update Document Library metadata but cannot add files in any of Document Library.

Actual behavior

Add-PnPFile : Access denied. You do not have permission to perform this action or access this resource. At line:1 char:1

Steps to reproduce behavior

Connect-PnPOnline -Url [site]-AppId [appid] -AppSecret "secret"

Add-PnPFile -Path c:\temp\sample.doc -Folder Documents

Which version of the PnP-PowerShell Cmdlets are you using?

What is the version of the Cmdlet module you are running?

SharePointPnPPowerShellOnline 3.9.1905.1

How did you install the PnP-PowerShell Cmdlets?

ghost commented 4 years ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

liridonuka commented 4 years ago

After updating Cmdlet version worked fine