Stack Exchange Network

Stack Exchange network consists of 174 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

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
vote
1answer
21 views

Can i run “DemoteNewsArticle” & “CommentsEnabled” commands without altering the ModifiedBy and Modified fields and without sending users alerts

I am working on a SharePoint online classic team site. and from time to time I run these remote power-shell commands:- 1- To un-post a modern page from being shown as News:- $clientSidePage = Get-...
0
votes
3answers
51 views

Hide Default Title Column via Powershell sharepoint pnp Module

I was wondering if anyone knew how to Hide the Default Title Column when you create a new List using the Powershell Sharepoint PNP Module. I've been trying the following $field = get-pnpfield -...
0
votes
1answer
28 views

Unable to create a site column named Department using PnP/power-shell script. Error “A duplicate field name ”Department“ was found.”

I am working on a sharepoint online enterprise wiki site collection. and i want to create a new site column named "Department" of type choice. now i already know that there is a built-in column which ...
2
votes
0answers
22 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-...
0
votes
2answers
46 views

SharePoint Online: Cannot read user profile property via CSOM / PnP - why?

We created a custom user profile property. We want to read it's value via CSOM (or PnP, doesn't matter). We fail. Our property is not returned in the list of user profile properties. Other ...
0
votes
1answer
34 views

PnPPowerShell cmdlets throw “The request channel timed out attempting to send after 00:00:30”

Lately, I've noticed that Cmdlets such as Get-PnPListItem, Get-PnPFile and Get-PnPProperty throw the error The request channel timed out attempting to send after 00:00:30. Increase the timeout value ...
1
vote
1answer
95 views

How to generate SharePoint Online site audit report using PowerShell?

I want to generate the audit log report with different activities and download to the local disc from SharePoint Online Site. The functionality is provided by Share Gate tool which I assume to be ...
0
votes
0answers
15 views

PnP Site Provisioning saving site template, but not homepage

I am using PnP PowerShell to save a SharePoint TeamSite (STO#3) as a provisioning template. This works fine. However, the homepage of the site is not being saved. My PowerShell Script: # Variables ...
0
votes
0answers
54 views

PowerShell: Retrieving Permissions of a Folder Problem or Limitation?

We're using SharePoint Online and we've been following the PnP solution: Retrieve Permissions at folder and file level in Powershell This works fine to a certain degree and my general question is ...
0
votes
0answers
18 views

Create survey in Sharepoint Online with powershell PnP

I have to create the same survey several times at several websites. I would like to automate this with a PowerShell script preferably with PnP cmdlets. It is possible to create a survey with ...
1
vote
3answers
51 views

Provisioning a Site template to several SharePoint Group Sites with PowerShell

I am trying to search for site collections which are of the type "Office 365 Group site collections (GROUP#0)" and then want to apply the Provisioning Template to all the group sites returned in the ...
0
votes
2answers
91 views

Export Import Workflow SharePoint Online

I have got created a list workflow in SharePoint Designer for a SharePoint Online Site Collection. Now I want to export this workflow and import it automatically to a new site collection during / ...
2
votes
0answers
25 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 ...
0
votes
0answers
13 views

Copy managed metadata term as a subterm using powershell?

Is there a way to copy an existing term and demote it to a subterm using Powershell?
2
votes
2answers
119 views

How get columns data from SharePoint document library using powershell

I want to export data from document library column into csv file using PowerShell. In document library i had column name "Post Code" under column i had different post codes as "XXXXX-12-AD-2345, ...
1
vote
0answers
38 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
27 views

Create Site Policy in SharePoitn Online with PowerShell/CSOM

I was researching for creating Site Policy in SharePoint Online with PowerShell/SharePoint but with no luck. Is it possible with SharePoint Online?
1
vote
2answers
72 views

SharePoint Online - 'Manage files with no checked in version' exceeds 5000 items treshold

I have a problem with thousands of files not being checked in after upload to one of our site collections. I can't open the list of files with no version through the UI because of the exceeded ...
0
votes
1answer
30 views

SharePoint pnp Powershell nocrawl on a list

How can I set a nocrawl on a list using SPPnp powershell? I tried the following but doesnt work: $list = Get-PnPList -Web $Web.Title -Identity $l if($list) { write-host $list.Title $list....
0
votes
1answer
34 views

Dynamic HashTable from a list in PnP PowerShell

Rather than create a static HashTable that is composed of the data from my list, I am looking to make it dynamic, but ran into some difficulty in constructing it. For example: Given that $items is ...
1
vote
2answers
152 views

how to update formula of calculated column using PnP in SharePoint Online

I want to update formula of calculated column using PnP or powershell. please note that i am using SharePoint Online. i tried below but its giving me error. please help. PS C:\Windows\system32> ...
0
votes
1answer
38 views

Set-PnPListItemPermission and Set-PnPListPermission - Does this send out a notification to the user?

I couldn't find in the docs if this was the case or not, I assume not, but I just want to make sure (and I have no test users to test with): If I use Set-PnPListItemPermission or Set-...
1
vote
1answer
15 views

How to differentiate between PNP powersehell command for sharepoint online versus sharepoint 2013

How to differentiate between PNP powershell command for sharepoint online versus sharepoint 2013? I have both installed Thanks in advance
2
votes
1answer
290 views

PnP Poweshell: Get-PnPListItem Restrict to a Specific View

I'm using Get-PnpList and Get-PnpListItem to retrieve all items in a specific list, but I would like to restrict the items to only those in a specific view? Is this possible? Maybe with a CAML query, ...
0
votes
1answer
62 views

Using restore-pnprecyclebinitems for sub-site use only

We have some files missing on a sub-site from which I have tried to use a script to restore. I connect to the context using connect-pnponline giving the specific team address t5\ts1. I confirm ...
0
votes
1answer
126 views

Pnp powershell boolean field

I want to create a boolean site column (yes/no field) througn pnp power shell. I used Add-PnPField command, but how to set default value to "no"
0
votes
1answer
51 views

PnP PowerShell command for Reuse Term

Is anybody know what is the PnP PowerShell command for Reuse Term and Pin Term functionalities?
0
votes
0answers
35 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 -...
2
votes
1answer
224 views

Connect-PnPOnline : The 'Connect-PnPOnline' command was found in the module 'SharePointPnPPowerShell2013', but the module could not be loaded.

I have installed PnP Powershell and I tried to run Connect-PnPOnline, but I got the following error: Connect-PnPOnline : The 'Connect-PnPOnline' command was found in the module '...
1
vote
0answers
19 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 ...
0
votes
1answer
186 views

Copy Sites Pages from one collection to another using PNP

I created over 50 Modern pages in one site collection, to realize they would be better housed in another site collection. Can I copy/move these pages from one collection to another ( or copy/move the ...
0
votes
0answers
60 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-...
1
vote
2answers
61 views

Can i create a custom permission level which allow users to ONLY create an item inside cusotm list. but they can not view,search,edit,delete items

I have a custom list inside our sharepoint online team site. and the team site have the publishing features enabled. the custom list is being used to submit users' feedback. So i want to create a ...
0
votes
1answer
152 views

PNP-PowerShell: Get items based on CreatedBy

I want to get all items(documents or list items) from SharePoint Online site and its sub sites based on createdBy using PnP-Powershell.
1
vote
2answers
120 views

SharePoint OnLine Using Cmdlet New-SPWOPIBinding

I am a young SharePoint OnLine user. I want Excel documents from all my sites to open directly with Excel and not Excel-OnLine. As I have a lot of sites and it would be long to make the sites one by ...
1
vote
1answer
143 views

Set choice column value for a new page using Sharepoint PnP

I am creating pages though Sharepoint PnP PowerShell and have been able to set the Title for the page. Add-PnPClientSidePage -Name "Sample Page" Set-PnPClientSidePage -Identity "Sample Page" -Title "...
0
votes
0answers
24 views

SharePoint Content Editor not displaying PnPJS Code

I want to be able to display my PnPJS code and make it show up within the Content Editor, but I am having trouble pulling the data in and displaying it. Here is what I have so far: 1.) I made a ...
1
vote
1answer
62 views

Using PnP PowerShell to find shares in Site / Document Library?

I am trying to find the list of shares in a site / document library / list using PnPPowerShell. Does such a Commandlet exist ?
3
votes
1answer
73 views

Set Userfield to allow Multiple using pnp in SharePoint Framework

I've Created a Field on my list PollAnswers and everything works fine with that part: pnp.sp.web.lists.getByTitle("PollAnswers").fields. addUser("Users", FieldUserSelectionMode.PeopleOnly).then(() =&...
1
vote
0answers
109 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
2answers
67 views

Content Type is provisioning in SharePoint Online

I am aware that custom content type will not be available immediately in any existing site when we create a new one. In my experience, I have seen that it takes somewhere around 6-8 hours to appear in ...
0
votes
1answer
89 views

Get-SPOSite does not work with ErrorAction

I am working with SharePoint PnP PowerShell and using below command. This command works but when the site does not exist it gives me an error on the screen even if I specified -ErrorAction:...
0
votes
1answer
370 views

Connect-PnPOnline forbidden 403 powershell

I am using the PnP modules to connect to a sharepoint site and retrieve its subsites and the lists within them. However when i try to use the below command it throws (403) forbidden error. #Variables ...
3
votes
2answers
39 views

Hiding system fields in the document library

I am using SharePoint 2016 and want to hide created, created by, modified and modified by fields. This is in the document library view and not the new, edit or display forms (i.e. if you click on a ...
0
votes
2answers
117 views

PNP Provisioning: read external content into template

Can I have the different sections of a PNP provisioning XML template in separate files and combine them when applying the template? Like having all lists in a lists.xml, refer to this list in the ...
2
votes
2answers
321 views

How to avoid credential popup, to connect with graph API in the powershell script?

I have written graph API to fetch user detail from the Sharepoint Online Connect-PnPOnline -Url $SPSiteURL -Credentials $PnPSPOCreds -Scopes "Group.Read.All", "User.Read.All" $apiUrl = "https://graph....
1
vote
0answers
124 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
2answers
235 views

Create child term under existing term

I am using below PnP PowerShell command to create new Term. New-PnPTerm In my case, I would like to create new term with custom properties under the existing term. I can't find a way to do this. Is ...
1
vote
1answer
67 views

Set View's internal name/url

I am using SharePoint PnP Powershell to create a view. In order to do this, I am using New-PnPView command and everything works. What I would like to do is set view's internal name. for e.g. List ...
1
vote
0answers
38 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 ...