-
Hi Team, At first, I would like to apologize in advance, as I'm afraid my question is a newbie question. However, I spend hours crawling the web to get some help and was not able to succeed, so here I am! ContextI'm expecting to have PnP Powershell (latest) working on a Win10 server with Powershell 7.2.2, with Office 365. ConnectionThe connection phase works well: For connection, I'm using the credential of a specific admin account, which as sufficient rights for accessing the SharePoint file I want to download (tested successfully using the web access to Office 365). IssueWhen trying to retrieve a file (I tried a couple of other commands with the same result), I have an immediate issue:
At this time, I was not able to locate any place where I could get additional logs to understand the root cause of the issue. Thanks in advance for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
(Still expecting some guidance... thanks!) I tried to get additional clues to understand my issue, but this was not very fruitful: `>Get-PnPFile -Url "/sites/(...)/(...).xlsm"
Version : 1.10.0.0 Was it? |
Beta Was this translation helpful? Give feedback.
-
I found that error when I ran PnP commands as a user that does not own the SharePoint site. Maybe try changing/adding the user in It's most likely an access permission issue. |
Beta Was this translation helpful? Give feedback.
-
Hi there, I should have reported sooner that I solved the issue by changing the way I connect. I thought a "global" connection on Sharepoint was possible but it needs to be more specific. Doesn't work:
Works:
So, I need to proceed with various Connect-PnPOnline when needing to access different subsites of my SharePoint structure. |
Beta Was this translation helpful? Give feedback.
-
I'm having a similar issue, although I'm running my PowerShell script via an Azure function with a system managed identity. My goal is to checkin Site Pages items that have no checked in version. The managed identity has both Graph and SharePoint ReadWrite and site full control permissions. When I run Invoke-PnPQuery, however, I get the following error: "ERROR: Attempted to perform an unauthorized operation." Here's my HttpTriggered Azure Function: Input bindings are passed in via param block.param($Request, $TriggerMetadata) Write to the Azure Functions log stream.Write-Host "PowerShell HTTP trigger function processed a request." Interact with query parameters or the body of the request.$libraryName = $Request.Query.LibraryName $siteUrl = $Request.Query.SiteUrl $body = "This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response." if ($siteUrl) { # Load the checked out files
} Associate values to output bindings by calling 'Push-OutputBinding'.Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{ |
Beta Was this translation helpful? Give feedback.
Hi there,
I should have reported sooner that I solved the issue by changing the way I connect. I thought a "global" connection on Sharepoint was possible but it needs to be more specific.
Doesn't work:
Works:
So, I need to proceed with various Connect-PnPOnline when needing to access different subsites of my SharePoint structure.