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.

0
votes
0answers
20 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
1answer
12 views

SharePoint Classic Experience

I currently had Classic Experience set to all site collections on SharePoint Online, however this morning it has changed all to modern experience for lists and libary. I would like to know what is ...
0
votes
0answers
18 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
1answer
16 views

Downloading files from Sharepoint Online - File Not Found - How to get correct URL for download?

I'm trying to download files being edited in Microsoft Teams/Sharepoint Online using various examples from the Internet (including the ones here). Currently I am using the Sharepoint PnP module: ...
0
votes
3answers
24 views

Remove-PnPSiteCollectionAdmin on none existing users

We are trying to clean up site collection administrators with following command: Remove-PnPSiteCollectionAdmin The problem is if the user has been removed from AD then this command fails. How do we ...
5
votes
3answers
71 views
+300

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 ...
0
votes
2answers
15 views

Powershell PnP attachmentfiles.serverrelativeurl

I am trying to get the Url for a list item attachment. From what I have seen, you should be able to access it like this $listitems = Get-pnplistitem -List MyList foreach($listitem in $listitems) { ...
0
votes
1answer
33 views

Create link to a document using PowerShell

Just wondering if you could help, I am looking to create a link to a file in a document library, essentially replicating this functionality: I was hoping it would be simple to do this using PnP ...
1
vote
0answers
16 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 ...
0
votes
2answers
22 views

Retrieve hub sites and associated sites using powershell

I got this pnp PowerShell to retrieve hub sites and associated sites. Can someone please help on how to get the output to a csv with the header? Right now it's writing to the host. List all sites ...
0
votes
0answers
18 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
19 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
30 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
18 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
2answers
30 views

Reset/Remove Default Column Values from folders

I am searching for a better way to reset/remove default column values from specific folders using PowerShell. I realize that it can be done through the library settings but I need to do this for ...
0
votes
2answers
33 views

Correct usage of Stop-PnPWorkflowInstance in SharePoint Online

A SPD workflow has become suspended, but I'm unable to cancel it. I'm trying to kill the workflow with the PNP command, but thats not working either, Am I missing something? I'm using:- Stop-...
0
votes
1answer
18 views

Will PnP Provisioning migrate workflows including with forms(infopath)

Can the PnP provisioning migrate infopath forms with workflows(SharePoint Designer) with ease? As anyone use this template successfully before ? Thanks in Advance
0
votes
2answers
33 views

Can we register an existing site collection as a Hub site

I am reading this official Microsoft documentation SharePoint classic and modern experiences, which mentioned that there is not a 1:1 map between site collections and hub sites, and we can not move a ...
0
votes
1answer
28 views

copied folder break inheritance fails

When i copy the folder with in same document library and trying to break inheritance it fails. below is the code for the same. Can any one help on the same Add-Type -Path "C:\Program Files\Common ...
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?
1
vote
1answer
90 views

How to copy the folder structure and permissions with in the same library

I have a document libray with structure like given below: FolderA->Subfolder1->item1 Subfolder2-->item2 They have folder level permissions . now ...
0
votes
0answers
18 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
2answers
26 views

Finding SharePoint Site Collection using just it's GUID

I am currently working with some code that gives me the following: Site Collection Guid I would like to fetch the site url using the site collection Guid with PNP PowerShell. Does anyone have any ...
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
1answer
28 views

Get all External Users of a SharePoint site using CSOM Powershell

i want all the external users of a SharePoint 2013 site using powershell CSOM or C# CSOM as we dont have tenant admin rights to use Connect-SPOservice command. Is there any script in PnP or CSOM to ...
0
votes
0answers
54 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
14 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
1answer
16 views

Add-pnpClientSideWebPart not working as expected

I´m trying to add a WebPart to a modern page via PnP. Add-PnPClientSideWebPart -Page "home.aspx" -DefaultWebPartType ContentRollup -Section 3 -Column 1 -WebPartProperties @{layoutid="List"} It ...
1
vote
1answer
36 views

Read Error when saving a list as a template in SharePoint Online

I am trying to save a list as a template with data to copy it to other sites for testing. When I attempt to Save the List as a Template, either from the list settings in the web UI, or with the ...
0
votes
1answer
67 views

New-PnPTerm : Specified argument was out of the range of valid values

I want to create a new term using PnP for our sharepoint online tenant, so i tried this PnP script:- PS C:\Windows> Connect-PnPOnline -Url https://****-admin.sharepoint.com PS C:\Windows> New-...
2
votes
2answers
58 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 ...
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
49 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
30 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
1answer
110 views

Sharepoint Set-PnpListItem is not updating value of sharepoint list column

i have powershell script of PNP for setting list item value using for loop. $ListItems_Values=(Get-PnPListItem -List fretag%20vrigt -Fields "FileLeafRef").FieldValues foreach ($item in $...
1
vote
1answer
42 views

The workflow is in an invalid state. Please correct it in SharePoint Designer and republish it

I have a SharePoint 2010 workflow created using SharePoint Designer 2013 during migration with Sharegate I get the error below:- The workflow is in an invalid state. Please correct it in SharePoint ...
0
votes
0answers
38 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
1answer
138 views

Get-PnpListItem HasUniqueRoleAssignments

I'm trying to retrieve list items that have unique role assignments from a list in SharePoint Online using Get-PnpListItem, is this possible? Currently this property is empty when using Get-...
1
vote
1answer
155 views

Update a site column Display name using PnP, to allow me to use existing Display Name

I am working on sharepoint online classic team site and i created a new site column using the site columns UI, as follow:- where the site column gets its display name and internal name as "...
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
1answer
35 views

How to run a report in a site collection that lists every site w/ users - Full Control

We are implementing a SharePoint based Knowledge Base. In each site collection, we need to deploy one or more "Knowledge Libraries" ... This is a document library that has a group of users with ...
1
vote
1answer
99 views

Add-PnPNavigationNode - How to set node order?

Quick question: Does anyone know of a way to change the order of the nodes in let's say the QuickLaunch nav when adding them via Add-PnPNavigationNode? I only know of the -first parameter. Thanks a ...
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
73 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 ...
1
vote
1answer
30 views

To check who is running scripts in On premise farm

Is there any way to get detailed report of who is running CSOM/JSOM scripts in SharePoint 2013 environment and what those scripts are doing?
0
votes
1answer
85 views

Get navigation nodes from top navigation in hub (3 levels)

I'm using PowerShell ISE and SharePointPnPPowerShellOnline to get the TopNavigationBar navigation nodes from a hub site. I want all nodes in all levels. The navigation is 3 levels as you can see on ...
1
vote
1answer
48 views

PowerShell script to get site collection administrators, site owners in SharePoint 2013 CSOM

i want PowerShell script for SharePoint 2013 CSOM to get below details site collection administrators site owners Site is multilingual or not Please assist.
1
vote
1answer
68 views

SPO vs PnP on classic / modern experience

Are there any limitations using SPO managment shell commands or PnP commands to manage SharePoint Online site, based on classic or modern experience? Problem underneath the question - I have a ...
2
votes
2answers
79 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. ...