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.

6
votes
1answer
156 views

How i can verify that our migrated “Contribute” permission level is exactly the same as the source Contribute permission

I did a migration from SharePoint on-premises 2013 to SharePoint online, using a third party tool, as follow:- The source on-premises site collection is a team site that have publishing features ...
6
votes
1answer
879 views

PnP powershell provisioning gives 401 error with tenant-scope (fullcontrol) app permissions

I want to create a new sitecollection with PnP Powershell and created an App with /_layouts/15/appregnew.aspx and granted permissions with: /_layouts/15/appinv.aspx. This is my permission request xml:...
5
votes
2answers
2k views

How to lookup AD users with pnp-powershell in SharePoint Online?

I have a script that will look up a user based on a folder name and then add that user to the folder permissions with read rights. Right now I have a few groups setup with explicit user assignment (i....
5
votes
0answers
62 views

Configure the maximum number of co-authoring authors in SharePoint 2013 at Farm Level

With the help of below script and based on my requirement I am able to set my limit for co-authoring the authors for sharepoint documents at site collection level $siteurl = "SiteURL" $mysite=new-...
4
votes
2answers
9k views

Retrieve Permissions at folder and file level in Powershell

We're on Sharepoint Online. After migration, would like to validate that all permissions are applied accordingly. Have following code : Connect-PnPOnline -Url $siteUrl $context = Get-PnPContext $...
4
votes
0answers
158 views

SP Online: Can you map a crawled property to a refinable managed property using export/import or PowerShell?

We have a SPFx solution and a requirement for which we need to map a crawled property to a RefinableDateXX managed property. We would like to ensure the proper search schema upon deployment, even if ...
4
votes
2answers
790 views

Find Document then Update Metadata

I am trying to apply a bunch of metadata to a bunch of files in SPO. Using Find-PnPFile I can find the files in the subfolders. What I cannot figure out is how to pass the results of the Find-PnPFile ...
4
votes
0answers
398 views

How can I make a copy of a workflow with PNP-PowerShell

I’m trying to use PNP-PowerShell to create a copy of a Sharepoint 2013 List Workflow on SharePoint Online. My script is as follows: Connect-PnPOnline https://tenant.sharepoint.com/sites/site -...
3
votes
3answers
942 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....
3
votes
1answer
147 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(() =&...
3
votes
1answer
82 views

PowerShell Script to Tune “Allows contributors to add or edit scriptable Web Parts.” to webapplication

I need to tune below option "Allows contributors to add or edit scriptable Web Parts" for particular web-application . Can any one help me in getting this through powershell script
3
votes
1answer
51 views

Sharepoint Design schema JSON for LayoutWebpartsContent

I am Searching for JSON format and documentation of creating a page with web parts in it using Sharepoint Design scripts JSON. After googling, I got the Schema for creating the page but for adding ...
3
votes
1answer
987 views

CAML Query all SharePoint documents modified in a given month

I want to list the all the files that were created, or modified in a given month in a SharePoint Online library. I would like to further recursively include any files in folders ( but excluding the ...
3
votes
1answer
120 views

How to create a Microsoft Team's General folder programmatically?

When I Team enable an existing Office 365 group via the New-Team cmdlet, the General folder in Shared Documents is not created automatically. I have to open Microsoft Teams and navigate to "Files" ...
3
votes
2answers
45 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 ...
3
votes
1answer
72 views

Export-Csv outputs pscustomobject NoteProperty values inline instead new line

I have a pscustomobject whose NoteProperty "Members" is populated with values within a loop. $results.Members += $currentGroupMember.Title When I do "Export-Csv" all values within "Members" are ...
3
votes
0answers
275 views

How to set ListExperienceOptions with PnP-Poweshell

How do I set the ListExperienceOptions of a list to ClassicExperience using the PnP-Powershell? I have tried this # Create the list to hold work Types New-PNPList -Title "Work Types" -Url "...
2
votes
3answers
144 views

How to determine what columns the sharepoint visitors group has

I have this line: get-pnpgroupmembers -identify "visitors group" | select title, email The code above gives me all members of the visitors group. I found the column Title and email, how can I find ...
2
votes
2answers
2k views

PowerShell Script to Find SharePoint List Template ID

I had written the below code to ignore the statements based on if condition, But find no luck. Can any one do let me know what's wrong in my below code $myListColl = $eachWeb.Lists; $mylistsToIgnore=...
2
votes
1answer
864 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, ...
2
votes
2answers
347 views

Connecting to SP2016 using PnP

I've used PnP a fair amount in the past when working with SharePoint Online, I'm now using it against a SharePoint 2016 on-prem environment. However, I'm having trouble getting connected. The SP2016 ...
2
votes
1answer
535 views

SharePoint/PnP PowerShell with PowerShell Core 6.0

Can we import SharePoint Online PnP powershell module in PowerShell Core 6.0 and use the cmdlets? I tried Connect-PnPOnline and I get the below error: The type initializer for 'Microsoft.SharePoint....
2
votes
1answer
91 views

How to get a CSV-file from a query on Sharepoint lists with PnPPowershell

I have 46 lists on my online sharepoint environment. I want a list in powershell of the last date of all the sharepoint lists. Here is a line of code which I have for every list: write-host "MYLIST: "...
2
votes
2answers
451 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, ...
2
votes
2answers
59 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. ...
2
votes
1answer
321 views

Add site collection level application catalog

I am using below PnP PowerShell command to add site collection level application catalog and giving me an Unauthorized error. I currently have owner access to the site. PowerShell $siteUrl = "https:/...
2
votes
3answers
28 views

Managed metadata service creation in SharePoint Online

How to create managed metadata service in SharePoint Online for creating a separate term store. Is there any powershell script as i cant see any out of the box option in admin centre.
2
votes
1answer
479 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 '...
2
votes
1answer
117 views

Add-PnPOffice365GroupToSite blows up on alias parameter

Using the script posted here: https://docs.microsoft.com/en-us/sharepoint/dev/transform/modernize-connect-to-office365-group I am trying to add an Office 365 group to a standard Team site ...
2
votes
1answer
824 views

Add QuickLinks with powershell-pnp

Has anyone figured how to add links on a quicklinks webpart on a modern page ? I've tried examining the propertiesjson output from the webpart but looks quite unclear. Thoughts?
2
votes
1answer
451 views

Restrict People Picker to SharePoint Online group programatically with CSOM and PowerShell

I need to update an existing people picker column on a site, to narrow down the list of possible users that can be entered. At present you can choose from All Users, I want to limit this to a ...
2
votes
0answers
57 views

Migrating the Rating for our discussion board list from on-premises to online

I have a team site inside our sharepoint farm 2013. and the team site contain a Discussion board list which have rating enabled. now using a third party tool named share-gate i migrated the team site ...
2
votes
1answer
693 views

Enable communication site at the root of a tenant

Iam trying to enable Communication Site on the root site level, but without any luck... Step 1 was to follow jimyHang blog, but this approach is not supported anymore, it is not posible anymore... ...
2
votes
0answers
46 views

Provision site with pnp package gives file not found error

I would like to move the provisioning templates to SharePoint Online so I need to convert them to pnp package. I try to convert a folder with provisioning files using the Convert-...
2
votes
0answers
98 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-...
2
votes
0answers
51 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 ...
2
votes
0answers
899 views

The Push Notifications feature is not activated on the site

All of a sudden I started to seeing below error with PnPPowershell. Get-PnPContentType : The Push Notifications feature is not activated on the site When I googled I got below article which ...
2
votes
1answer
429 views

Remove List Items for SP List Exceeded Threshold

I have a SPO list where the threshold has exceeded the threshold of 5000. I need to remove 6761785 items and counting. I have tried to use the following PNP but not having much joy $items=Get-...
2
votes
0answers
184 views

Set-PnPListItem throws Access denied error

I am trying to update item in "User Information List" using "Set-PnPListItem". but i'm getting following error. Set-PnPListItem : Access denied. You do not have permission to perform this action or ...
2
votes
0answers
623 views

Powershell script to make then save changes to Word Document in document library

I am writing a (PnP) Powershell script to update hyperlinks on any word document in a SharePoint online subsite. I have used the following link for guidance. My script isn't as complex as the link ...
2
votes
0answers
148 views

Any SharePoint tools to convert Server Object Model Code to Powershell

Is there any tool to convert the SharePoint server object model to PowerShell?
1
vote
1answer
996 views

Export/import content type to another site collection pnp powershell

Could someone suggest me a simple powershell script I can use to copy a content type and a list (excluding the content) from one site collection to another. I am thinking it can easily be done using ...
1
vote
3answers
1k views

How to get Field values of a list item using CSOM Powershell?

How to get Field values of a list item using CSOM Powershell? I am using below code: foreach($field in $List.Fields) { write-host $field } I am getting the values as output: Microsoft....
1
vote
1answer
42 views

Retrieve Items in Video Document Library using PowerShell

I'm wanting to retrieve all items within a Video Library on SharePoint and grab the owners/Created By list and all that I haven't been able to target videos only. I'm able to pull in all of the ...
1
vote
1answer
171 views

How to get a list of all the members in the Visitors-Sharepoint group using PnPPowershell

Does anyone know the PnPPowershell-code for gettings all the members of a certain SharePoint-group (in my case the Visitor-group). Greetings, P
1
vote
1answer
94 views

Alternative PnP commands to SharePoint Online Commands

Are there any alternative PnP commands to SharePoint Online Commands such as: Connect-SPOService Disconnect-SPOService Set-SPOUser Set-SPOSite Get-SPOSite Add-SPOSiteCollectionAppCatalog Thank you ...
1
vote
2answers
218 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
2answers
175 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 ...
1
vote
1answer
243 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:...
1
vote
1answer
204 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 ...