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
0
votes
0answers
11 views

Programatically define document set default view

Im trying to be define a document set default view from powershell, code, csom, or site template, but I cant find any way to do so. My library have 5 views, and I have a document set XX added to the ...
0
votes
1answer
9 views

How to set up a single site app catalog?

Can anybody point me in the right direction on how to set up an App catalog for a single site in my tenant (SharePoint online)?
0
votes
1answer
16 views

get the recent file

I am logging into the sharepoint webiste and getting folder contents as follows: $connection = Connect-PnPOnline -Url $siteName -Credential $credential -ReturnConnection $wholeContent = Get-...
0
votes
1answer
18 views

Disable access request for all SharePoint online Sites

When users create SharePoint sites, By default access requests and Sharing are enabled. I would like to disable this feature globally on my SharePoint online Tenant.
0
votes
2answers
40 views

login to sharepoint site with the service account instead

I have got a service account (Windows AD Data Mgmt) from the company admin so that I can do the following using PowerShell: Login(Connent-PnPOnline) to a SharePoint site. Download a file and process ...
0
votes
1answer
34 views

Adding multiple or an array of values using Set-PnPPropertyBagValue

I would like to add an indexed property bag value to some of my SharePoint Sites that is called "former names". I would like to add multiple string values or an array of string values under the one ...
0
votes
1answer
27 views

PNP Apply-ProvisioningTemplate - SharePoint List's field is skipped if of different type

I am currently using Azure Build and Release Pipelines to automate deployment to a testing environment. A PowerShell script is used to re-apply a template.xml file for the sites lists and libraries ...
0
votes
1answer
22 views

Submit-PnPSearchQuery - Does this search inside documents?

We have several documents in our online SharePoint site. We need to write a Powershell script that will return a list of all documents with a specific word in it. Is this command supposed to return ...
0
votes
0answers
34 views

PnP SharePoint Powershell command throws exception

We are using PnP powershell which works as expected. However, sometimes we face an exception intermittently with the error as given below. The PnP powershell script line is Connect-PnPOnline -Url $...
0
votes
2answers
86 views

Can i update the enterprise wiki pages' content type and page layout using PnP, without affecting the pages' metadata

I have migrated an old enterprise wiki site collection 2013 to SharePoint online. I did not create the source site collection, and i found that the wiki pages are associated with the built-in ...
1
vote
2answers
54 views

Pnp powershell script find propertyBag on SPO Hub Site -Assocated

Is there a way to find the properties of the site/web using Get-PnPPropertyBag by looping through a Hub site and associated sites? Get-PnPPropertyBag -Key MyKey only for one site properties, but I ...
0
votes
0answers
25 views

Change the “site property” web part via PS

I have hundreds of pages in a site page library. All of them have the "site page" web part and currently shows things like keywords, published date etc. I want to add another field/property to this ...
1
vote
2answers
49 views

What is the definition of “Custom Action” in PnP?

I am an Admin for SP2010, SP2013 and SP2016 on-premise farm and I never use SP online before. Recently I am checking the ability of SharePoint PnP PowerShell and found it also support SP2016 on-...
1
vote
1answer
21 views

PNP set created by Value for a Document Library

When i am trying to do a bulk import of files using PNP i am unable to retain the created by Value (The files are in a local file share) .I am able to set all the other values (Created,Editor,Modified)...
1
vote
1answer
14 views

PnP Provisioning Tenant how to migrate one tenant to another location

Is there a possibility to migrate all resources from one tenant to another? How Could we Migrate them to deploy from the testing environment to the production environment?
0
votes
0answers
51 views

PnP Powershell - Updating the Search Settings

My site collection on SP2016 looks like: /sites/mySiteCollection /sites/mySiteCollection/TopLevelSite-A /sites/mySiteCollection/Subsite-A1 /sites/mySiteCollection/Subsite-A2 ...
0
votes
0answers
18 views

Azure Runbooks attempts 3 times but no error

Param ( [Parameter (Mandatory= $true)] [string] $siteUrl, [Parameter (Mandatory= $true)] [string] $DocLibName ) #Connect to SPO $tenantName= "client" $username = "admin@client.onmicrosoft.com" $...
1
vote
3answers
34 views

How to get a Sharepoint-group with its members displayed in PowerShell

How to get a SharePoint-group with its members displayed in PowerShell. I have tried this: Get-PnPGroupMembers -Identity "xxxxxxxxxxxxxxxxx" | select title But doesn't give me the results I would ...
1
vote
2answers
18 views

(PnP Powershell) Note type fields appear to be empty when versioning is enabled

I'm trying to build a script that will copy the contents of a list from a site to another list in a subsite or a different site. Unfortunately many multiline text fields (FieldType = Note) appear to ...
1
vote
0answers
61 views

Powershell script to update a column for a given list item/site page

I have a powershell script that uses a variable $pages (containing all my publishing sites in a library) in a foreach, converts them from classic pages to modern pages and export them to a external ...
0
votes
1answer
49 views

Megamenu and powershell

Is there a way for me to have a SharePoint Online modern list that I can use to make item entries in the SharePoint Megamenu via powershell? SharePoint list has: URL - name of my SharePoint page ...
2
votes
1answer
36 views

Can't delete field in sharepoint online pnp

Title is a default column that comes with a generic list which I want to remove. Any idea how to make this work? Pnp: # CREATE NEW LIST $22 = New-PnPList ` -Title 'Honours' ` -...
0
votes
1answer
24 views

New-PnPSite - But create a hub site?

Is their a way to use New-PnPSite to create a hub site? Register-SPOHubSite or a PNP version of this command?
0
votes
0answers
11 views

How to add Choice Add-PnpField that uses term store meta data for the choices?

How can I change my code below so that I am using the term store data for my choices when adding a new pnp field? I have tried googling for an answer but no luck! Any help is much appreciated <3 #...
0
votes
2answers
80 views

New-PnPSite - Check if site is allready created?

# CREATE COMMUNICATION SITE New-PnPSite ` -Type CommunicationSite ` -Title $team ` -Url ("https://hiddenforsecurity.sharepoint.com/sites/" + $team) ` -SiteDesign 'Blank' I need to wrap this ...
1
vote
3answers
45 views

add-pnpfield -required not working

$fix11 = Add-PnPField ` -DisplayName 'Date of Birth' ` -InternalName DateofBirth ` -Type Date ` -Required ` -Group 'Football Content Types' The Required parameter doesn't seem to work, any ...
1
vote
2answers
166 views

format-default : The collection has not been initialized. It has not been requested or the request has not been executed

# CONNECT TO TENNANT try { Connect-PnPOnline ` -Url https://bpk.sharepoint.com ` -Credentials 'pnpdemo' } catch { Write-Host ` -f red "Error: $($_.Exception.Message)" } # CREATE ...
0
votes
3answers
47 views

Add-PnPView - Sort by Ascending order?

# CREATE VIEW QUERY $Query="<OrderBy><FieldRef Name='Name' Ascending='TRUE'/></OrderBy>" # CREATE VIEWS FOR PLAYER BIO Add-PnPView ` -List 'Player Bios' ` -Title 'All Players' ` ...
0
votes
1answer
48 views

Add-PnPField how to set it to be a required field?

# CREATES NEW FIELDS FOR PLAYER BIO CONTENT TYPE Add-PnPField ` -DisplayName 'Squad Number' ` -InternalName SquadNumber ` -Type Number ` -Required:$true ` -Group 'Football Content Types' I ...
0
votes
1answer
14 views

migrate Access database to Sharepoint and preserve ID column

I would like to migrate access databases to SharePoint Online, and sometimes the built-in migration wizard fails. I can create the missing tables and relink them with a macro, but I have trouble ...
0
votes
0answers
23 views

SharePoint Online - PowerShell edit items in Quick Links

Is it possible to edit the items in an existing Quick Links web part using PowerShell PnP? I have seen posts about using the SharePoint workbench to get the JSON required to create a new web part. ...
0
votes
1answer
25 views

p1 script not running with schedule job

I have SP2010 in WIN2008R2, i have script(datemodifier.ps1) to update the diff of 2 dates in SP list daily, When I run the script manually its updating the list, but when i schedule it with a task on ...
0
votes
1answer
73 views

need help-SharePoint online powershell to copy choice to managed metadata column

can anyone please help me out with the PowerShell or any-other solution here. I have a SharePoint library with 4000 documents and it has a choice column called "test". and each document is set with ...
0
votes
1answer
29 views

SharePoint Online Site inherit security group from hubsite

Is there a PowerShell script/cmdlet (pnp/spo) to inherit securitysettings from hubsite? All sites linked to hubsite https://tenant.sharepoint.com/sites/marketing should have the same permission ...
1
vote
0answers
42 views

Provisioning Microsoft Teams from azure function via pnp powershell

I am provisioning Teams via PnP powershell and it requires -Scopes. The only way to get -Scope is through interactive log in. This further means (which i am thinking) is that you can not use "Apply-...
0
votes
0answers
16 views

Generate a thousand team sites from a spreadsheet and associate them to a hub site

As a part of testing out some functionality on my local SharePoint Online tenant, I would like to provision the creation of about 2,000+ modern Team Sites (not attached to a group) based on a list of ...
0
votes
0answers
14 views

Set-PnPDefaultColumnValues Error applying default column values

I am trying to set a default value for a taxonomy field on a SharePoint document library using a PowerShell script. The GUID is the guid of a term copied from the Term Store Set-...
0
votes
0answers
40 views

SharePoint Document Library Group By Paging (PnP View Edit)

SharePoint Document Libraries have the "Item Limit" per page. In the New Experience, when you get to that "Limit" the library loads another page of documents. Conversely in the Old Experience, you ...
0
votes
0answers
20 views

Get recurrence exception data using powershell

I need to be able to get data about the exceptions to a recurring appointment in a SharePoint Online calendar. Simplest would be to use SharePoint/PNP PowerShell. Right now on my test case, if I use ...
0
votes
1answer
62 views

How to copy Content Type from one site collection to another (Both site collection having different template) SharePoint Online

We are looking for copy a content type from one site collection to another. Both site collection having different site template. How to copy content Type from one site collection to another in ...
0
votes
2answers
80 views

Adding Lookup Field to a SharePoint list via PowerShell (SharePoint/PNP)

I am trying to create a lookup field via Sharpoint PNP PowerShell module. And here is my script: $URL = "https://testing.sharepoint.com/sites/sitename" Connect-PnPOnline -url $URL -Credential ...
0
votes
1answer
65 views

Moving Document Library to a subsite in SharePoint

Currently, we have Document Libraries created in SharePoint Online and would like to move them using Powershell to its own Subsite. The reason we would like to move them is that we would like to keep ...
1
vote
1answer
49 views

Set-PnPGroupPermissions library still accessible

I want to break inheritance to a library and then remove members and visitors group. The code below works apart from the fact the library is still accessible but the content is not. The Quick launch ...
0
votes
0answers
33 views

Access Denied while retrieving Get-PnPProvisioningTemplate

I am using modern authentication to extract pnp provisioning template from modern sharepoint site online. But I am unable to retrieve and getting Access Denied exception. Tried in Google but no luck. ...
0
votes
2answers
54 views

SharePoint PnP - Get-PnPField - Only Columns visible to Super User

When using Get-PnPField, is there a way to only pull fields that are available for editing the settings GUI? Get-PnPField pulls all the fields including some system-related.
1
vote
1answer
65 views

Pnp PowerShell Get-PnpFolder gives error on Method “GetFolderByServerRelativePath”

I'm using Sharepoint Pnp PowerShell against a SharePoint 2013 server on-prem and whenever I try to use Get-PnpFolder, it gives the error: Method "GetFolderByServerRelativePath" does not exist The ...
0
votes
0answers
35 views

Exception calling “ExecuteQuery” with “0” argument(s): “Unknown Error”

I am working on a modern team site collection inside our sharepoint online tenant. I want to associate a JSLINK with a site column, so i run this PnP script:- $User = "***@***.onmicrosoft.com" $...
0
votes
1answer
56 views

Create document library from template with PowerShell

I'm attempting to create a document library from a .stp template. To my knowledge the script worked and now its not. I get an error when the following is executed: $ListCreation.ListTemplate = $...
0
votes
2answers
35 views

Installing SharePoint Framework Extensions Online

I'm trying to install SharePoint Framework Extensions from here. However, I have no clue sadly on how to convert the JSON to SSPKG file so that I can upload to app catalog. I have checked SharePoint ...
0
votes
1answer
99 views

SharePoint 2019: Moving documents between Site Collections

I'm currently looking for a sneaky solution to move documents between SIte Collections. I already found a quite good looking PnP Powershell: Connect-PnPOnline -Url https://intranet.customer.com/...