Questions tagged [pnp-powershell]

PowerShell commands that allows you to perform complex provisioning and artifact management actions towards SharePoint. The commands use CSOM and can work against both SharePoint Online as SharePoint On-Premises.

Filter by
Sorted by
Tagged with
7
votes
1answer
1k views

PnP powershell provisioning gives 401 error with tenant-scope (fullcontrol) app permissions

I want to create a new sitecollection with PnP Powershell and created an App with /_layouts/15/appregnew.aspx and granted permissions with: /_layouts/15/appinv.aspx. This is my permission request xml:...
6
votes
5answers
672 views

Batch update via PNP Powershell

I have data from a CSV that will be imported and added to column values for each of these items. I can loop over CSV, get the items, and set the values (Set-PNPListItem) - but the sequential ...
6
votes
1answer
169 views

How i can verify that our migrated “Contribute” permission level is exactly the same as the source Contribute permission

I did a migration from SharePoint on-premises 2013 to SharePoint online, using a third party tool, as follow:- The source on-premises site collection is a team site that have publishing features ...
5
votes
3answers
12k views

Retrieve Permissions at folder and file level in Powershell

We're on Sharepoint Online. After migration, would like to validate that all permissions are applied accordingly. Have following code : Connect-PnPOnline -Url $siteUrl $context = Get-PnPContext $...
5
votes
2answers
3k views

How to lookup AD users with pnp-powershell in SharePoint Online?

I have a script that will look up a user based on a folder name and then add that user to the folder permissions with read rights. Right now I have a few groups setup with explicit user assignment (i....
5
votes
0answers
191 views

SP Online: Can you map a crawled property to a refinable managed property using export/import or PowerShell?

We have a SPFx solution and a requirement for which we need to map a crawled property to a RefinableDateXX managed property. We would like to ensure the proper search schema upon deployment, even if ...
5
votes
0answers
73 views

Configure the maximum number of co-authoring authors in SharePoint 2013 at Farm Level

With the help of below script and based on my requirement I am able to set my limit for co-authoring the authors for sharepoint documents at site collection level $siteurl = "SiteURL" $mysite=new-...
4
votes
4answers
181 views

How to add JSLink to a field through pnp?

I am trying to add a JSLink to my field through pnp so that it displays diffrently in the edit/new mode in the list that it is connected to, the problem i am having is that pnp throws an unknown error ...
4
votes
2answers
1k views

Find Document then Update Metadata

I am trying to apply a bunch of metadata to a bunch of files in SPO. Using Find-PnPFile I can find the files in the subfolders. What I cannot figure out is how to pass the results of the Find-PnPFile ...
4
votes
0answers
466 views

How can I make a copy of a workflow with PNP-PowerShell

I’m trying to use PNP-PowerShell to create a copy of a Sharepoint 2013 List Workflow on SharePoint Online. My script is as follows: Connect-PnPOnline https://tenant.sharepoint.com/sites/site -...
3
votes
2answers
138 views

How to disable “Connect to Teams” banner in SharePoint Online

We have a set of Group connected Team sites in SharePoint Online and we don't want to connect them to Microsoft Teams due to some specific business need. The problem is that whenever an Owner of the ...
3
votes
2answers
651 views

Connecting to SP2016 using PnP

I've used PnP a fair amount in the past when working with SharePoint Online, I'm now using it against a SharePoint 2016 on-prem environment. However, I'm having trouble getting connected. The SP2016 ...
3
votes
3answers
2k views

How to avoid credential popup, to connect with graph API in the powershell script?

I have written graph API to fetch user detail from the Sharepoint Online Connect-PnPOnline -Url $SPSiteURL -Credentials $PnPSPOCreds -Scopes "Group.Read.All", "User.Read.All" $apiUrl = "https://graph....
3
votes
1answer
29 views

SharePoint PnP PowerShell Provision world clock webpart on Modern page

I am working on modern team site page provisioning using pnp powershell. We are trying to add the world clock webpart on page, but we are not getting the internal name of the world clock webpart to ...
3
votes
1answer
38 views

How to set 'other label' value of a term set?

I am using the PnP commands to add new terms to an existing group, but I am not sure how to set 'other label' fields to add aliases to the term. I am trying to add a financial accountplan with ...
3
votes
1answer
197 views

Set Userfield to allow Multiple using pnp in SharePoint Framework

I've Created a Field on my list PollAnswers and everything works fine with that part: pnp.sp.web.lists.getByTitle("PollAnswers").fields. addUser("Users", FieldUserSelectionMode.PeopleOnly).then(() =&...
3
votes
1answer
1k views

Add QuickLinks with powershell-pnp

Has anyone figured how to add links on a quicklinks webpart on a modern page ? I've tried examining the propertiesjson output from the webpart but looks quite unclear. Thoughts?
3
votes
1answer
85 views

PowerShell Script to Tune “Allows contributors to add or edit scriptable Web Parts.” to webapplication

I need to tune below option "Allows contributors to add or edit scriptable Web Parts" for particular web-application . Can any one help me in getting this through powershell script
3
votes
1answer
208 views

Apply-PnPProvisioningTemplate : Input string was not in a correct format

I try to export and import template using below PnP powershell scripts. There is no issue while exporting the template. But I get "Apply-PnPProvisioningTemplate : Input string was not in a correct ...
3
votes
1answer
102 views

Sharepoint Design schema JSON for LayoutWebpartsContent

I am Searching for JSON format and documentation of creating a page with web parts in it using Sharepoint Design scripts JSON. After googling, I got the Schema for creating the page but for adding ...
3
votes
1answer
1k views

CAML Query all SharePoint documents modified in a given month

I want to list the all the files that were created, or modified in a given month in a SharePoint Online library. I would like to further recursively include any files in folders ( but excluding the ...
3
votes
1answer
247 views

How to create a Microsoft Team's General folder programmatically?

When I Team enable an existing Office 365 group via the New-Team cmdlet, the General folder in Shared Documents is not created automatically. I have to open Microsoft Teams and navigate to "Files" ...
3
votes
2answers
51 views

Hiding system fields in the document library

I am using SharePoint 2016 and want to hide created, created by, modified and modified by fields. This is in the document library view and not the new, edit or display forms (i.e. if you click on a ...
3
votes
1answer
88 views

Export-Csv outputs pscustomobject NoteProperty values inline instead new line

I have a pscustomobject whose NoteProperty "Members" is populated with values within a loop. $results.Members += $currentGroupMember.Title When I do "Export-Csv" all values within "Members" are ...
3
votes
0answers
310 views

How to set ListExperienceOptions with PnP-Poweshell

How do I set the ListExperienceOptions of a list to ClassicExperience using the PnP-Powershell? I have tried this # Create the list to hold work Types New-PNPList -Title "Work Types" -Url "...
2
votes
3answers
216 views

How to determine what columns the sharepoint visitors group has

I have this line: get-pnpgroupmembers -identify "visitors group" | select title, email The code above gives me all members of the visitors group. I found the column Title and email, how can I find ...
2
votes
2answers
2k views

PowerShell Script to Find SharePoint List Template ID

I had written the below code to ignore the statements based on if condition, But find no luck. Can any one do let me know what's wrong in my below code $myListColl = $eachWeb.Lists; $mylistsToIgnore=...
2
votes
1answer
1k views

PnP Poweshell: Get-PnPListItem Restrict to a Specific View

I'm using Get-PnpList and Get-PnpListItem to retrieve all items in a specific list, but I would like to restrict the items to only those in a specific view? Is this possible? Maybe with a CAML query, ...
2
votes
1answer
941 views

SharePoint/PnP PowerShell with PowerShell Core 6.0

Can we import SharePoint Online PnP powershell module in PowerShell Core 6.0 and use the cmdlets? I tried Connect-PnPOnline and I get the below error: The type initializer for 'Microsoft.SharePoint....
2
votes
1answer
419 views

How to get a CSV-file from a query on Sharepoint lists with PnPPowershell

I have 46 lists on my online sharepoint environment. I want a list in powershell of the last date of all the sharepoint lists. Here is a line of code which I have for every list: write-host "MYLIST: "...
2
votes
1answer
58 views

PnP (PowerShell)

new to SharePoint (on premise-2013), I've been learning PnP for a few weeks. I would like to make a tree view of any library and I'm searching for a fast way to display the file/folder hierarchy. I ...
2
votes
2answers
616 views

How get columns data from SharePoint document library using powershell

I want to export data from document library column into csv file using PowerShell. In document library i had column name "Post Code" under column i had different post codes as "XXXXX-12-AD-2345, ...
2
votes
2answers
272 views

Content Type is provisioning in SharePoint Online

I am aware that custom content type will not be available immediately in any existing site when we create a new one. In my experience, I have seen that it takes somewhere around 6-8 hours to appear in ...
2
votes
1answer
628 views

Add site collection level application catalog

I am using below PnP PowerShell command to add site collection level application catalog and giving me an Unauthorized error. I currently have owner access to the site. PowerShell $siteUrl = "https:/...
2
votes
2answers
2k views

Cannot download file in SP Online using Get-PnpFile

Hi why do I receive a file not found error when downloading a file from SharePoint Online using Get-PnpFile in PowerShell even though I can get its details on my first line of code below: I just ...
2
votes
2answers
142 views

Pnp powershell asking credentials again and again

In PnP PowerShell for SharePoint 2013 site, how to give credentials only once, so that it will not ask credentials again while connecting to different site collections coming from a CSV file input. ...
2
votes
1answer
29 views

Converting PnP Powershell Online code to SharePoint 2013

I've written some code using PnP PowerShell for SharePoint Online, but I now need to port it to SharePoint 2013. While I had full control on SharePoint Online, I have no Admin rights to SharePoint ...
2
votes
1answer
39 views

Change Modern Page Banner using PowerShell PnP: BannerImageUrl

We have an automated process of generating sample Modern pages for DEV/QA purposes. One challenge is to setup the page header's BannerImageUrl property to the Modern Page. The obvious first attempt ...
2
votes
2answers
65 views

Migrate a term from sharepoint on-premises to sharepoint online, to have same name & GUID

I have 2 farms sharepoint on-premises 2013 & sharepoint online. where we use to have a license for a third part migration tool, and we have migrated around 70% of the sites, but still the ...
2
votes
3answers
35 views

Managed metadata service creation in SharePoint Online

How to create managed metadata service in SharePoint Online for creating a separate term store. Is there any powershell script as i cant see any out of the box option in admin centre.
2
votes
1answer
693 views

Connect-PnPOnline : The 'Connect-PnPOnline' command was found in the module 'SharePointPnPPowerShell2013', but the module could not be loaded.

I have installed PnP Powershell and I tried to run Connect-PnPOnline, but I got the following error: Connect-PnPOnline : The 'Connect-PnPOnline' command was found in the module '...
2
votes
1answer
206 views

Add-PnPOffice365GroupToSite blows up on alias parameter

Using the script posted here: https://docs.microsoft.com/en-us/sharepoint/dev/transform/modernize-connect-to-office365-group I am trying to add an Office 365 group to a standard Team site ...
2
votes
1answer
503 views

Restrict People Picker to SharePoint Online group programatically with CSOM and PowerShell

I need to update an existing people picker column on a site, to narrow down the list of possible users that can be entered. At present you can choose from All Users, I want to limit this to a ...
2
votes
0answers
68 views

Migrating the Rating for our discussion board list from on-premises to online

I have a team site inside our sharepoint farm 2013. and the team site contain a Discussion board list which have rating enabled. now using a third party tool named share-gate i migrated the team site ...
2
votes
1answer
1k views

Enable communication site at the root of a tenant

Iam trying to enable Communication Site on the root site level, but without any luck... Step 1 was to follow jimyHang blog, but this approach is not supported anymore, it is not posible anymore... ...
2
votes
0answers
80 views

Provision site with pnp package gives file not found error

I would like to move the provisioning templates to SharePoint Online so I need to convert them to pnp package. I try to convert a folder with provisioning files using the Convert-...
2
votes
0answers
228 views

Best practice provision form library with custom template

I exported a site collection template that I wanted to apply a brand new site collection. The problems start with the form libraries: <pnp:ListInstance Title="Form-Index" Description="Form-...
2
votes
0answers
93 views

Match/move based on data in the title of a document to folder of the same name

So I have a Library with a list of documents. These docments (PDFs) are named in the following format. DeptCode_MgrNumber_MgrLast,MgrFirst_EmpName_634242 I would like to find a way to ...
2
votes
0answers
1k views

The Push Notifications feature is not activated on the site

All of a sudden I started to seeing below error with PnPPowershell. Get-PnPContentType : The Push Notifications feature is not activated on the site When I googled I got below article which ...
2
votes
1answer
164 views

overwrite existing field pnp

I am using pnp to import my content types and columns etc. I used to have a lookup field but I am wanting to change it to a lookup multi. I have done all of this but when I run the script to import it ...