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.

5
votes
0answers
70 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
167 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
419 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
290 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
59 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
53 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
143 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
66 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
0answers
196 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
667 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
164 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
9 views

Using powershell,How to export all subsites,lists with list items(Title,ID,Author) of specific site collection?

I want to export hierarchy of site collections in excel like this using powershell. Site Collection - "https://sitename.sharepoint.com" Subsite1 - "https://sitename.sharepoint.com/S1" ...
1
vote
0answers
18 views

How to change published date of a modern page / clientsidepage in SharePoint Online?

we are trying to migrate classic pages to modern and it's a must to maintain the initial publishing date of the page. This date should be visible in the page header: Digging around we found that ...
1
vote
0answers
47 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
103 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
45 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
104 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
53 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
24 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
117 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
39 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
237 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
359 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
68 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
199 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
129 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
196 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
94 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
87 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
23 views

Change position of Title field in list, in Site Design script

When I create a list in a site design script (via createSPList -> Add-SPOSiteScript -> Add-SPOSiteDesign), the Title field is automatically added. I've found out how to remove the Title field by using ...
0
votes
0answers
19 views

Can I change the site homepage within a Site Design script?

I've created a site design based on a number of scripts in PowerShell (via Add-SPOSiteScript -> Add-SPOSiteDesign). This creates a design with a number of lists & views, and adds URLs to those ...
0
votes
0answers
24 views

Cant Delete Field in SP Online List

The event content type was added to my list, I've removed it and disabled content type management on the list. I was able to remove all columns brought in with the event content type, except the "...
0
votes
0answers
20 views

Disable welcome email for 365 groups/modern team sites

Is there any similar for c# for those PowerShell command? Set-UnifiedGroup -Identity "DynO365" -UnifiedGroupWelcomeMessageEnable:$false I need to disable the welcome email when adding users from ...
0
votes
0answers
31 views

Apply site theme or design with PnP Provisioning

I would like to replicate the option available under "Settings - Site Design - Chose Site design - Apply to site within a PnP site provisioning template. This is a newly created subsite under an ...
0
votes
0answers
25 views

Could not load type 'Microsoft.SharePoint.Administration.DesignPackageType' from assembly 'Microsoft.SharePoint.Client'

When I try to load "Microsoft.Online.SharePoint.PowerShell" got below error. Not sure where I am going wrong here. Microsoft.Online.SharePoint.PowerShell 16.0.8924.1200 ...
0
votes
0answers
10 views

Clear-PnPDefaultColumnValues issue with managed metadata field

I am able to Set-PnPDefaultColumnValues without an issue. But when I try to Clear-PnPDefaultColumnValues I receive the below error. The field in this case is a Managed Metadata field. PnP version 3.9....
0
votes
0answers
9 views

Powershell script to get all site pages which has yammer webpart

Is there any powershell script to get all site pages (Title, site link) within the site collection, which has yammer web part in SharePoint online?
0
votes
0answers
19 views

Export Import Term Sets with PnP

I'd like to export a term set from one SP 2016 environment to another. I wanted to use this command: Export-PnPTaxonomy as in here: https://docs.microsoft.com/en-us/powershell/module/sharepoint-pnp/...
0
votes
0answers
23 views

Using Sharepoint PnP to get SchemaXml and use it while provisioning an SPFx List Instance

I am creating an SPFx Web Part that will provision a list instance upon installation. I have successfully created and provisioned a basic list, however i cannot seem to customize it by altering the ...
0
votes
0answers
55 views

PnP Powershell - SPO - request channel timed out (Get-PnPTerm)

When trying to run a Get-PnPTerm cmdlet to return all terms in a large termset (10k or even 60k items), most of the time I get a timeout error as below: Get-PnPTerm : The request channel timed out ...
0
votes
0answers
17 views

Provisioning Quicklinks

I have a request to create a template that includes a QuickLinks web part. I noticed that PNP exports the web part like this: </pnp:CanvasControl> <pnp:CanvasControl WebPartType="QuickLinks" ...
0
votes
0answers
15 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
58 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
33 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
43 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
33 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
23 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
77 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
19 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 ...