pnp powershell
7 TopicsRename-pnpFile gives me access denied with admin rights
Hello! I have problems renaming my files. I'm using these commands: #this is one command i tried connect-pnponline -url "https://contoso.sharepoint.com/sites/Clients" -interactive -validateconnection $file = Get-PnPFile -Url "/sites/Clients/folder/subfolder/IT_testi_password.txt" Rename-PnPFile -SiteRelativeUrl $file -TargetFileName "renamedfile.txt" -Force -Verbose # this is another connect-pnponline -url "https://contoso.sharepoint.com/sites/Clients" -interactive -validateconnection Rename-PnPFile -SiteRelativeUrl "/sites/Clients/folder/subfolder/IT_testi_password.txt" -TargetFileName "renamed.txt" -Force -Verbose I tried those commands too with overwrite but I only get access denied (I dont know what is checking to say me that because i can put everything in the source and it says me same ) the error: #I'm putting this error to show that i can put anything i want Line | 4 | Rename-PnPFile -SiteRelativeUrl "asrfeqrew" -TargetFileName "workingc … | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Access denied. PS /Users/user> #and this one is a common one Rename-PnPFile: /Users/user/Desktop/project/Scripts/Untitled-1.ps1:4:1 Line | 4 | Rename-PnPFile -SiteRelativeUrl "/sites/Clients/folder/subfolder/IT_testi_password.txt" -T … | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Access denied. I'm using visual studio with a mac and have Sharepoint administrator right, also i can rename the same file via web. Can someone help me with this problem?1.6KViews0likes4CommentsContent editor web part losing table format and images inside a table on editing the modernized page
Problem Area Page Transformation: Error during the use of page transformation from PnP PowerShell Expected or Desired Behavior Content in the tables having custom formatting for the table and images added within the table cells in the content editor web part in the classic web part pages should be modernized properly. PnP PowerShell Online Version Details: Name: SharePointPnPPowerShellOnline Version: 3.29.2101.0 Observed Behavior Content in the content editor web parts having tables with formatting and images within the table are migrated properly but when we edit the page and save the modernized page, it is losing its table format along with the inline images in the table. Classic Web part page Modernized page Edit and save the modernized page You can notice, it is losing the image on save and for other cases it is also losing formatting in the tables which has highly customized formatting. Steps to Reproduce Create a classic web part page -> add content editor web part -> Insert tables -> apply custom formatting -> add images in the table cell -> save the page Then use the below script to modernize the page: ConvertTo-PnPPage -Identity $page.FieldValues["ID"] -Overwrite -DisablePageComments -AddTableListImageAsImageWebPart: $false -ClearCache -SkipItemLevelPermissionCopyToClientSidePage -TakeSourcePageName:$TakeSourcePageName -LogType File -LogFolder $LogOutputFolder -LogVerbose -LogSkipFlush -KeepPageCreationModificationInformation -CopyPageMetadata775Views0likes0CommentsHow to retrieve nodes in another language with Get-PnPNavigationNode in PnP PowerShell?
Get-PnPNavigationNode returns the node titles in the default language of the site (I guess). Is there a way to retrieve the nodes translated in another language? I could not find a way to change the language on the connection or context. Can we somehow add the "accept-language" header to the request sent to the REST services? I assume this would help to retrieve the values for the corresponding language.1.9KViews0likes4CommentsTime is offset with pnp provisioning
I have an issue while I use pnp provisioning engine : When the provisioning is performed the time on the event dates of my list are offsetted by one hour (I presume because my site is UTC+1). And then when I apply the provisioning template, this offset is not set to the target. So I have a Time offset between my two sites. On my source site In my provisioning template xml On my target site713Views0likes0CommentsProgramatically change the new menu in modern libraries
I am creating a lot of document libraries with code in our enterprise and each library should have different content types. Unfortunately after updating the content types with CSOM, the default Word, Excel and PowerPoint templates disappear from the New-Menu in a modern library. Instead the content types are shown. Because I am not able to change the edit menu in hundreds of libraries back to the default, I would like to archive this within my software. I already found how to do this with pnp powershell here, but would like to do it from withint C# (REST or CSOM) Any ideas how I could archive that?2.6KViews0likes1CommentGet column position of webpart modern SharePoint page
Who could help me? For some good reason I have to get the column and section of an existing webpart that I want to use later in my Powershell script. Now I can easily get the section and use it again. But I cannot get the column as a variable. I already tried it as you see below with a substring or a split. But I noticed that different results came back at different sites. So again, who knows the solution for me?Solved2.4KViews0likes4CommentsRandom issues with Pnp Powershell in Azure Runbooks
Hi everyone, we're facing random issues when running PnP powershell from Azure runbooks when several instances of the same runbook run concurrently. The scenario We have several of runbooks, they all use PnP Powershell, and each of them perform different actions, such as Enabling site collection app catalog, scripting, external sharing, creating a list etc. Those runbooks get triggered in two different ways: - one is triggered after a new site is created, through a site script, that triggers a logic app and from there we trigger the runbook - the others are triggered via webhook (http post from a function attached to a queue) The issues When the same runbook is triggered more than once at the same time, they fail in different ways: - we see the logs being logged more than once, then the runbooks get suspended - pnp randomly fails, it does not enable the site catalog, or enable scripting, etc - if we put our code inside a try catch block, we use to read weird errors (null reference, invalid connection when using Connect-PnPOnline, etc) Some errors are: Set-PnPTenantSite : Object reference not set to an instance of an object. At line:41 char:9 Connect-PnPOnline : Token request failed. At line:31 char:5 Set-PnPTenantSite : No connection, please connect first with Connect-PnPOnline At line:41 char:9 Add-PnPSiteCollectionAppCatalog : Object reference not set to an instance of an object. Background info: The runbooks were never executed at the same time against the same site. When we trigger them concurrently, we only do it for 10 sites, and the runbooks are pretty simple (connect to the tenant, enable site collection app catalog, and then disconnect) Any ideas? Thanks5.5KViews0likes1Comment