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
8 views

Programatically Deploy List Item Layout

Suppose we created a list with a custom list form layout. Now, I want to move this list to a different SharePoint tenant/site. How do I programmatically apply the custom form laout? More details I am ...
0
votes
1answer
17 views

Is it possible to limit permissions when using PnP PowerShell or SharePoint Online Management Shell to a user's existing permissions?

I have Microsoft Teams team Owner permissions in Office 365 and all users in our organisation can create teams. Many of my tasks involve introducing efficiencies using tools such as Power Automate, ...
0
votes
1answer
24 views

How to export or backup column formatting JSON values?

Is there a way to export or backup the column formatting JSON that has been applied to SharePoint list columns? Obviously, column formatting is so useful that it is often applied to lots of lists, and ...
0
votes
0answers
11 views

Error when trying to register the PnP.PowerShell App Registration when you’re not a Tenant Admin

I'm trying to deploy starterkist spfx webparts using the below Apply-PnPTenantTemplate -Path starterkit-spfx-only.pnp I get this error Apply-PnPTenantTemplate : Please provide consent to the PnP ...
0
votes
1answer
35 views

Group Permissions in SharePoint 2013

I have SP 2013 sites. I want to read the group on user.aspx page with permission level. But I am getting error on get permission. some one help me with this. $SiteGroups = Get-PnPGroup Write-host &...
0
votes
0answers
20 views

Inventoring SharePoint Online Custom web parts

I want to list all the custom web parts from a SharePoint Online Site using PowerShell. So far I have the command Get-PnPApp so I could use PnP commands. Also the command $web.AppTiles lists the ...
0
votes
0answers
10 views

Upload template.pnp to SPO site collection and having it as template option when creating new site

I have the testtemplate.xml and testtemplate.pnp files ready for a new template that I would like to deploy in my site collection. How can I achieve this in a way that when I want to create a new site ...
0
votes
0answers
20 views

Applying SharePoint Lookbook Template to Existing Tenant Site

I am hoping to deploy a Sharepoint Lookbook template on a SharePoint Online server, of which I am the tenant admin. I've downloaded the templates from the lookbook github repo. All documentation I've ...
0
votes
2answers
16 views

Delete onenote using powershell

I have multiple OneNote inside site assets library. I want to delete the one note which is created on my name. I am using SharePoint online sites I want to delete it using PowerShell. pls some one ...
0
votes
1answer
18 views

Share a site with a Microsoft security group using PowerShell

On a SharePoint Online site, you can access this menu through Site Permissions -> Advanced Permissions Settings -> Grant Permissions. I have a Microsoft security group created, and my goal is ...
1
vote
1answer
34 views

How to restore all Items from Recycle bin from a particular SharePoint online library using PnP PowerShell?

I have a SharePoint online library called MyLibrary, it contains approx. 4000 items. The items got deleted, and I need to restore them using PnP PowerShell, the following are the challenges I am ...
0
votes
1answer
19 views

SharePoint .Net CSOM Equivalent for Add-PnPFile

We have a requirement to use CSOM based .Net Managed Code to perform the upload file and set the metadata properties. However, we cannot upload and set the metadata properties simultaneously using ...
0
votes
0answers
19 views

PnP-PowerShell how to get data-attr value from PnPFile

I'm trying to get the value of a data-attr="value" from a list of SharePoint site pages. I'm new to PnP PowerShell and SharePoint so any help in understanding is greatly appreciated. This is ...
0
votes
1answer
21 views

Looking for the property name used to toggle to show user picture in SharePoint list field settings

For a given SharePoint list column of type User there's a column setting, a toggle that allows to show the user profile pictures instead of names only. I was looking to toggle this via PowerShell but ...
1
vote
0answers
10 views

Fix 'Accept-Language' header for a CSOM request in PowerShell script

I'm trying to fix the language of a PnP PowerShell request. Specifically, I'd like to extract site scripts from a web in a neutral language. Here's what I tried : $cnx = Connect-PnPOnline -...
0
votes
1answer
38 views

List Schema XML

I have SharePoint 2013 sites and I have created the task list. Now I want to export that Schema XML using CSOM or PnP PowerShell. Can someone suggest me?
3
votes
1answer
31 views

Get members of a private channel in Microsoft Teams

Connect-SPOService -Url https://site-admin.sharepoint.com $privateSites = Get-SPOSite | Where-Object -Property Template -eq "TEAMCHANNEL#0" Any attempt to get the list of members for a ...
0
votes
1answer
28 views

Change how members can share files, folders, and the site using PowerShell

Is it possible to change the Site sharing settings using PnP PowerShell or SPO PowerShell? This includes 'Sharing permissions' as well as 'Access Requests'. These settings for any site can be found ...
0
votes
0answers
13 views

Assign user as site admin of every site in a hybrid SharePoint environment without delay

Our company recently moved to a hybrid solution, and we're looking to create a detailed report on every site. A global admin or SharePoint admin can't access these details, it requires a site admin on ...
0
votes
1answer
20 views

Get-PnPMicrosoft365GroupOwners returning PnP.PowerShell.Commands.Model.Microsoft365User instead of owner names

Here is the code I am running. I am able to get groupIds, but when using the Get-PnPMicrosoft365GroupOwners, the owners are displayed as PnP.PowerShell.Commands.Model.Microsoft365User. I will attach ...
0
votes
0answers
43 views

Extracting data audit log report for Power BI pro users using PowerShell

We written PowerShell script for extracting audit log data for Power BI pro user. Previously it was working fine, past one month onwards, we are getting access dined error while running script. We are ...
0
votes
0answers
12 views

PNP POWERSHELL provisioning security handlers

We are successfully getting SharePoint groups with SiteSecurity handler in PnP provisioning PowerShell Is there any way to skip members of these SharePoint groups. We are using templates across the ...
0
votes
1answer
28 views

Sync hub permissions to associated sites via Pnp Powershell

I cannot find a setting to sync hubsite permissions to associated sites. The option isn't enabled when you register a hub site via PowerShell, and I cannot find out how to throw this switch ...
0
votes
1answer
20 views

Cloning SharePoint Modern site

I have a SharePoint Modern site that I want to clone. I want to create almost like a "staging" version of my modern site. Which will have all my lists and even the items in those lists if ...
0
votes
0answers
22 views

Add Translator for Multilingual in Sharepoint using pnp powershell

I need to add multilingual language and translator using the script (PnP PowerShell). I can manually do it as following: I need the same functionality using the PowerShell scripts. I can add the ...
0
votes
0answers
28 views

SharePoint Online PnP PowerShell

I am trying below to turn off the offline availability on SharePoint Online sites: $SiteURL = "https://tenantname.sharepoint.com/" $Cred = Get-Credential #Connect to SharePoint Online ...
0
votes
1answer
37 views

Task List in SharePoint 2013

I want to export the task list which has enabled Send e-mail when ownership is assigned in the list using PowerShell: $ctx=Get-PnPContext $Lists = Get-PnPList $ctx.Load($Liss) $ctx.ExecuteQuery() ...
0
votes
1answer
54 views

RowLimit not working in PowerShell Get-PnPListitem

I am trying to get few items from SharePoint list so I am using RowLimit in a query, but it doesn't seem to work. $query = "<View><Query> <Where><Eq> <FieldRef Name='...
0
votes
1answer
9 views

Get-PnPListitem with query filtered by number, converted to string, not working

I have a powershell script where I need to get some items from SharePoint online list, filtered by one value in string column, and it only works if I put value in quotes. $Number=123 # NOT working, no ...
0
votes
1answer
27 views

Restore all permissions on a sharepoint site Sharepoint Online

Restore all permissions on a sharepoint site, we have a sharepoint site that I have deleted several permissions at random and so I will need to restore the permissions (go back to the 05/29/2021 ...
0
votes
0answers
23 views

Check if content editor or script editor web part is present in the list forms (New/Display/Edit form) using PowerShell (CSOM/PnP)

I am trying to check if the content editor or script editor web part is present on the list forms (NewForm, EditForm, DisplayForm) in SharePoint 2013. I can get the web part type from web part page ...
0
votes
0answers
46 views

Connect to SPO site with Proxy settings

I'm trying to connect to a SharePoint Online site using the Connect-pnponline cmdlet, but facing a proxy issue for the same. The exception I'm getting is : "Error: exception has been thrown by ...
0
votes
1answer
29 views

URL Mapping File Format, PnP PowerShell, ConvertTo-PnPPage Cmdlet

I can't find any references to the format of the Url Mapping File used with the ConvertTo-PnPPage cmdlet in PnP PowerShell. Can someone point me to a reference or provide an example? Thanks! Cmdlet ...
0
votes
1answer
81 views

Setting 'Created', 'Modified' and 'Modified By' properties with PnP PowerShell Add-PnPFile

I am moving files from a file share to SharePoint Online. The files are in different folders, one for each release, on the file share. The idea is that these releases should be visible in the version ...
0
votes
2answers
35 views

Get-PnPView : Object reference not set to an instance of an object

I need PnP command to check if view exist on list before creating view. Get-PnPView -List "list1"-Identity "view1" However, I am getting below error if view doesn't exists. If ...
1
vote
0answers
52 views

PnP.PowerShell - Adding/importing Taxonomy / Managed Metadata to SharePoint Online

Context I have a several old (pre-PnP.PowerShell) scripts used to query/add/update various SharePoint Online Term Sets, and want to update these to work with PnP (as well as generally improve/re-work ...
0
votes
1answer
65 views

PnP Powershell - Export list of folders

I need to export a list of all the folders, sitting under all the sites associated with a HUB Site, which are modified between a specific date range into a CSV file. Could I please get some help?
0
votes
1answer
48 views

SharePoint 2016 Cumulative Update steps

I was able to install the CU for SH 2016 on each server after running the command Suspend-SPEnterpriseSearchServiceApplication –Identity “<Search Service Application Name>” Except the APP and ...
0
votes
0answers
28 views

Optimizing Connections

I have a script that makes multiple actions (create site, add users, tweak permissions, copy homepage, etc) and I'm using several cmdlets (maybe not the right definition...) to achieve this. We begin ...
0
votes
0answers
18 views

CSOM - ApplyProvisioningTemplate - Access denied. You do not have permission to perform this action or access this resource

I was using ApplyProvisioningTemplate function with PnP.Framework as below code for applying template . it used to work without an issue. but i randomly get the below error with following message . ...
0
votes
0answers
16 views

OfficeDevPnP.Core.AuthenticationManager is returning this error “The remote server returned an error: (401) Unauthorized.”

I have a .Net console application and i am using this code to authenticate to the sharepoint online:- static void Main(string[] args) { //customer sites string siteUrl ...
0
votes
0answers
31 views

Get page content of SharePoint online classic page

I need to get page content of a page that is in subsite. I am not sure how to go about this. The page content hyperlink which I need to get. Whats is the best way of going about it. I essentially want ...
0
votes
1answer
90 views

Delete unique permissions of a File or Folder in a document library

I have a document library which has 3 folders in it and inside each folder there is a document (docx, xls, ppt). My objective is to iterate every file inside my document library and check if It has ...
0
votes
0answers
84 views

Escaping strings containing single quotes in PowerShell

How can i replace/escape the single quote in the name cai.o'dowd as its causing errors string is i:0#.f|membership|cai.o'dowd_hod.com#ext#@xyz.onmicrosoft.com Currently i'm doing the below and ...
1
vote
1answer
110 views

How to get the list item ID of a nested library folder using PnP PowerShell?

I am trying to add metadata to document library folders created using the Add-PnPFolder command. I've been using the Set-PnPListItem command to do this, which requires the folder's list item ID. ...
0
votes
1answer
54 views

Export Security group using PowerShell

I have SharePoint 2013 sites. I want to export all the security group in Csv file. I want the security group name and the principle type of the group. Also, it is located in site level or subsite ...
1
vote
3answers
89 views

Generate a List of External Users for SharePoint Online

Is there a way to generate a list of all External Users for the Entire SharePoint Online Tenant?
0
votes
0answers
85 views

An error occurred while enumerating through a collection: The collection has not been initialized

I have this script which gives a report of files/items in a list or library with unique permissions: #Function to Get Permissions on a particular on List, Folder or List Item Function Get-...
0
votes
2answers
23 views

Is Custom Script Enabling required for PNP PowerShell?

We are generating a PNP PowerShell to copy any document library files to file share. The issue we are facing is with "Get-PnPListItem" command. When we try with a tenant that has custom ...
1
vote
1answer
59 views

SharePoint Online: View on Document Library Subfolder Does not Display Folder Files

I'm using the PowerShell script below to create views on a SharePoint Online document library with subfolders. The script creates the view, but does not display the files contained in the subfolder. ...

1
2 3 4 5
12