Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

3
votes
1answer
73 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 ...
2
votes
1answer
432 views

Remove List Items for SP List Exceeded Threshold

I have a SPO list where the threshold has exceeded the threshold of 5000. I need to remove 6761785 items and counting. I have tried to use the following PNP but not having much joy $items=Get-...
5
votes
0answers
62 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
0answers
158 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 ...
4
votes
0answers
400 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
0answers
276 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
0answers
57 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
0answers
46 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
100 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
53 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
917 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
0answers
184 views

Set-PnPListItem throws Access denied error

I am trying to update item in "User Information List" using "Set-PnPListItem". but i'm getting following error. Set-PnPListItem : Access denied. You do not have permission to perform this action or ...
2
votes
0answers
624 views

Powershell script to make then save changes to Word Document in document library

I am writing a (PnP) Powershell script to update hyperlinks on any word document in a SharePoint online subsite. I have used the following link for guidance. My script isn't as complex as the link ...
2
votes
0answers
148 views

Any SharePoint tools to convert Server Object Model Code to Powershell

Is there any tool to convert the SharePoint server object model to PowerShell?
1
vote
0answers
32 views

Compact code for generating report for all groups all members within a site collection

I would like to create a report that contains all subsites and all associated groups and members. This is what I have so far: Get-PnPGroup -PipelineVariable g | Get-PnPGroupMembers | ForEach { [...
1
vote
0answers
60 views

catch statement does not work SharePoint Online PNP

I have written a powershell script which downloads files from sharepoint using PNP. This works fine however I am trying to do some error catching when the file does not exist add it to a csv however ...
1
vote
0answers
35 views

Display only the date and not the time in Pnp-PowerShel

I have this PnP-Powershell line that gives the last date in het column Date of a SharePoint list. Even thou in the list column are only dates displayed. With this command i get also the time. How can ...
1
vote
0answers
86 views

Apply-PnPProvisioningTemplate issue

I am getting below error message when I tried to apply a xml template to SharePoint Online site: powershell_ise.exe Error: 0 : 2018-11-29 08:11:45.1338 [Fields] [11] [Error] Adding field {...
1
vote
0answers
42 views

PnP commands to disable the “Documents” feature from users' Delves pages

when users access their Delve accounts inside office 365 there is an option to disable the "Documents" features, as follow:- Changing this option will disable the "Documents" feature for the login ...
1
vote
0answers
23 views

How can I force a PowerShell runbook return English error messages

I have a localized tenant and troubleshooting a SharePoint provisioning runbook. My problem is that it returns mixed (localized and English) error messages. Like New-PnPWeb gives English errors, but ...
1
vote
0answers
90 views

Put an Image webpart (Image/Image gallery) on the top of a Modern SP page with Powershell (PnP)

I need to communicate an important information (picture) on Team Site homepages so I decided to add on the top of every homepages an Image Webpart (to know : homepages already has some webparts). I ...
1
vote
0answers
38 views

Teams -Reached catch method Error occurred while executing Code: GeneralException Message: Failed to start/restart provisioning of Team InnerError

I was trying to create Teams using Powershell script as below $GroupID = (New-Team -DisplayName $TeamName -AccessType Private -Description $TeamDescription).GroupId in general this code execute well ...
1
vote
0answers
215 views

Read webpart Data - Sharepoint Online powershell

I have a requirement where I need to find if there is a table in the pages on my website. I thought of writing a PowerShell script for getting all the webparts in the page and reading the content ...
1
vote
0answers
279 views

Not able to Load Managed Metadata Context

I am trying to create Term with PowerShell in SharePoint Online to do so I have written below code but on [Microsoft.SharePoint.Client.Taxonomy.TaxonomySession]::GetTaxonomySession($spContext) ...
1
vote
0answers
63 views

Update metadata of many items in library

I have the requirement, that the values for two of my site columns of all our document libraries depend on a value outside of SharePoint (its stored in a database). If the value in the database ...
1
vote
0answers
175 views

Find all InfoPath Forms in SharePoint Online and when last used?

I am new to this site and have a few questions that I will post. I have used this site quite a bit in the past for answers, but just recently joined and want to thank everyone for their contributions. ...
1
vote
0answers
118 views

powershell script to sync sharepoint on premise environments

I'm after a script in powershell or if using PNP is easier to be able to have content databases etc..sync in different environments e.g dev,test Any suggestions or tips would be appreciated
1
vote
0answers
192 views

Export the user list and there corresponding permissions for the entire site collection

I am looking to export the users and there permission level at site collection level. Could any one please help me how can I do this with powershell script
1
vote
0answers
89 views

Csom Powershell script to check Web Part Page and Wiki page

We are required to find out the number of wiki pages and web part pages present in a site pages library across all the webs in a big site collection, this needs to be determined in sharepoint online,...
1
vote
0answers
84 views

How to delete the permission level using power shell using CSOM?

I need to delete the default permission level in SharePoint site using power shell CSOM. Like - Full Control - contribute - List item - edit
0
votes
0answers
12 views

Editing Content Types in Sub-Folders of a Library

We have 10,000+ documents to update the content type on. We cannot find a way of doing this manually, require some sort of script that would enable us to do this. I have found scripts that change ...
0
votes
0answers
17 views

Get users who have permission through a sharing link Powershell sharepoint Online

I want to generate a report of every document and permissions on it. Permissions contains General Permission and Users who have permission through a sharing link/ or external sharing link. When I run ...
0
votes
0answers
21 views

Combine PnP templates with master template

I would like to create a smart way to manage large templates with as less manual work as possible. So, I created a small script to export different parts of a site collection like: $parts = "Lists","...
0
votes
0answers
25 views

Unable to pass Set-PnPListItem a hashtable as value

Set-PnPListItem should set users in list fields but I can't get the format right. Usually, I would set it like documented, i.e. @{"PersonField" = "user1@domain.com","21"}. However, in my case each ...
0
votes
0answers
27 views

How to access the Security trim for SharePoint Online using Powershell

I have been trying to access the securitytrim (_layouts/15/SiteNavigationSettings.aspx)context under the sitenavigationsettings page in sharepoint online. I can do them easily for the on premise ...
0
votes
0answers
16 views

Get-PnPProvisioningTemplate : Get additional pages from Pages library as a part of the XML file

How can i get the pages from Pages library as a part of the XML file?
0
votes
0answers
12 views

SharePoint Online- Remove-PnpFile question

I have a script that is working to download files from an online SharePoint Document Library to a network drive. Now I just need to be able to delete the files that have already been downloaded from ...
0
votes
0answers
12 views

Provision a list with attached content type and site columns

I have a custom content type defined in the contenthub, with attached custom site columns. I want to provision a list (via site script and site design). But with the solution I have, the content type ...
0
votes
0answers
26 views

PnP MIME Type configuration allowing browser view

I would like to view trusted PDF or HTML files directly in browser without downloading them. Is there a way to activate browser view from any PnP library (SharePointPnPPowerShell say)? The examples ...
0
votes
0answers
56 views

Upload file to Sharepoint Online using the url only

I would like to update all files on a site. I can collect the files I want: $files = Find-PnPFile "TEST.XML" -Web $web foreach ($file in $files) { #here I make changes ... #and would like to ...
0
votes
0answers
69 views

Add-PnPContentTypeToList does not add content type when using -web parameter

I am looping through subwebs and am trying to add a content type to a specific list using the code below, but it does not add it. I don't get any errors. Add-PnPContentTypeToList -Web $currentSubWeb -...
0
votes
0answers
114 views

How to specify the format of a URL field using pnp powershell?

I am using pnp-powershell to create a fields and one of them is a Hyperlink Or Picture. Using the script below I don't find a format option. Can anyone tell me how can I specify the format? add-...
0
votes
0answers
54 views

Get an inventory of all InfoPath forms

So I'm looking to generate a list of all Lists AND Form libraries that use InfoPath forms in SharePoint Online. I see lots of scripts for one or the other but not both. Anyone?
0
votes
0answers
51 views

Upload file to form library

I try to upload and xml file to a form library with PnP Powershell, Sharepoint online. Add-PnPFile -Path "path\test.xml" -Folder "myLibrary" This works fine with new files. However, when I try to ...
0
votes
0answers
351 views

Getting a 'Method not found' Error using Connect-PnPOnline

Trying to use Connect-PnPOnline to access SPO to run PowerShell script. PS>Connect-PnPOnline -Url $tenancy -Credentials $mySPOCredentials Connect-PnPOnline : Method not found: 'System.Threading.Tasks....
0
votes
0answers
19 views

Manage metadata Service in sharepoint powershell online

I have created manage metadata List column which has multiple values in my list . now i want to assign the terms from power shell through CSV. Is it similar like a choice ?? I tried like this but no ...
0
votes
0answers
179 views

Error on executing the post method of Invoke-RestMethod

We have executed the PowerShell script to call the Microsoft Team and create the Microsoft planner of office 365: Install-Module SharePointPnPPowerShellOnline -SkipPublisherCheck -AllowClobber -Force ...
0
votes
0answers
166 views

Can't create a new team site inside organization with Chinese region

So I try to create a new team site in an organization with Chinese region. And my(code c# or powershell) gives me the same error New-PnPSite : {"d":{"CreateGroupEx":{"__metadata":{"type":"Microsoft....
0
votes
0answers
286 views

Add lookupfield using powershell

I would like to add a lookupfield as a sitecolumn using PowerShell...but I don't want to use xml definition. Anybody has a solution using pnp cmdlets ? Thx
0
votes
0answers
445 views

Why doesn't this code set SharePoint online modern banner image?

I have tried the following but it doesn't change the actual image on the page when you view it in the browser. Set-PnPListItem -List "SitePages" -Id 2 -Values @{"BannerImageUrl" = " https://contoso....