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.

-1
votes
0answers
10 views

Apply-PnPProvisioningTemplate : The remote server returned an error: (403) Forbidden

I am developing a script to create/update group/team sites from a SharePoint list. I have everything working, but I am struggling big time with authentication. I use Connect-PnPOnline -Url https://...
0
votes
0answers
9 views

Connect-PnPOnline -PnPO365ManagementShell

I am trying to connect to PnPOnline using the following Connect-PnPOnline -Url https://Company.sharepoint.com/sites/testclientsite -PnPO365ManagementShell -LaunchBrowser After authenticating through ...
0
votes
0answers
4 views

Get-PnPSearchConfiguration returns only one vaiue SharePointPnPPowerShellOnline

I am attempting to export the definition of all managed properties for am online site collection. The connection to the site works find and SharePointPnPPowerShellOnline returns an object, but it ...
1
vote
2answers
111 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 ...
4
votes
3answers
56 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 ...
1
vote
1answer
27 views

SharePoint online powershell script timezone issue

I developed a script to add calendar events for our SharePoint on-premise for ET timezone, but when I run the same script for SharePoint online, I see a difference in the timezone though my regional ...
1
vote
1answer
20 views

PowerShell to import promoted results into SharePoint online

My organisation is migrating from SP2010 to SPO and would like to use PowerShell to migrate the best bets from SP2010 to promoted results in SPO. I currently have a csv file of promoted results and ...
6
votes
5answers
146 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 ...
1
vote
1answer
26 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
1answer
27 views

Delete O365 groups and SP online site with PowerShell

I was looking for a easy way to delete hundreds of test site in a modern SharePoint online env. MS flow didn't to the trick, so I was looking into PowerShell. Set-Location -Path C:\scripts #Connect ...
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
3answers
26 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 ...
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
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
1answer
37 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
1answer
1k views

Disable Read Only SharePoint Content Types - Powershell

I use the PnP Commandlets to do much of my site building but cannot figure out how to make Site Content Types not read-only. There is no way to do this with commandlets so I'm looking for some help. ...
0
votes
2answers
16 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
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 ...
1
vote
0answers
17 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
0answers
22 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
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
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
23 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
32 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
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
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
2answers
35 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
2answers
34 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
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
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?
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
2answers
27 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
30 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
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" ...
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
71 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
60 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
1answer
31 views

debugging remote event receiver using service bus not working

My scenario is i had a working application that i was able to debug perfectly some month back using service bus but is not working anymore. I don't have any errors and none of my breakpoints are ...
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
1answer
728 views

Fetch Username from Lookup-Column using Powershell-PNP

I am trying to retrieve the actual username from a lookup column , the closest I got is $test=(Get-PnPListItem -List $list -Fields Owner -Id 1).FieldValues This of course returns the value as ...
0
votes
0answers
57 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
32 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
121 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
43 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
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
1answer
146 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-...