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
1 answer
26 views

Get the Folder GUID using Power Shell

I am trying to get the folder GUID using its URL, i tried this power shell:- #Variables $SiteURL = "https://*****.sharepoint.com" $ServerRelativeUrl= "/Shared Documents/FolderA" ...
user avatar
  • 2,224
1 vote
1 answer
27 views

Set-PnPSearchConfiguration throws exception

Trying to apply search configuration to Tenant through following command: Set-PnPSearchConfiguration -Path "C:\temp\Search\02 - Test\searchconfig.xml" -Scope Subscription But it throws ...
user avatar
  • 199
0 votes
0 answers
14 views

Implement multilingual for existing SPO site collections

I've created a powershell script which uses PnP.PowerShell to create a new modern team site collection with custom site fields, content types, lists and quick launch navigation nodes in SharePoint ...
user avatar
  • 105
0 votes
1 answer
47 views

How do I get files' and folders' size and last modified time in PnP PowerShell?

I found a code snippet that loops through the files and folders in SharePoint, using PnP PowerShell, and retrieves the count. When I modify the code to also retrieve the last modified date and size ...
user avatar
  • 1
0 votes
1 answer
36 views

SharePoint Modern Site PnP provisioning issues with Lists

SharePoint Online (Microsoft 365) PnP.PowerShell - 1.10.0 I am using the following PowerShell commands to save a modern site as a template: $url = "https://<private>.sharepoint.com/...
user avatar
  • 1
0 votes
1 answer
17 views

Fail to pass multiple value to PnP powershell cmdlet

I need to add a Choice column with PnP cmdlet: $str = "Option A","Option B" Add-PnPField -List $ListName -Type Choice -DisplayName "Field A" -InternalName "Field A&...
user avatar
  • 4,016
3 votes
2 answers
111 views

Get the choice field options for SPO using PowerShell

I need to get all the choice options on a SharePoint Online List with PowerShell. I can find many sample scripts for on-premise SharePoint but I cannot convert them successfully in SharePoint Online. ...
user avatar
  • 4,016
0 votes
0 answers
35 views

Consuming Powershell Azure Function from SPFx webpart (no framework)

I've a working Azure Function(anonymous authentication) written in powershell. I'm trying to consume this in SPFx. I'm able to send the request to the azure function, but I'm unable to find a way to ...
user avatar
0 votes
1 answer
49 views

Unable to download files via powershell from Sharepoint Online?

I used to be able to download files from Sharepoint Online by logging in with Connect-PnPOnline and then running the following command; but today it put a real kink in my productivity and it didn't ...
user avatar
  • 101
0 votes
0 answers
9 views

List of Sites/Webs with Allow Access Requests Enabled

How can I iterate all tenant Webs and log if Allow Access Requests Enabled. I know how to iterate and set enable/disable this setting, but I'm not been able to just get this info. And what permissions ...
user avatar
  • 999
0 votes
1 answer
23 views

How to keep metadata when using Get-PnPFile?

Is there a way to keep the metadata from the files downloaded with Get-PnPfile? If(!(test-path $path)) { New-Item -ItemType Directory -Force -Path $path } Get-PnPFile -Url $itemServerRelativeUrl -...
user avatar
  • 103
0 votes
1 answer
37 views

Delete SharePoint Modern Page comments using PowerShell

I have a Site Pages library in Communication Site. I have to delete comments posted by 2 users on all the pages using PowerShell. There are many solutions available which use REST but I prefer to use ...
user avatar
  • 307
1 vote
2 answers
443 views

Connect-PnPOnline: Unsupported user type 'unknown'

I have installed SharePointPnPPowershell on my dev machine which is running SP 2016. I tried to connected to my local sharepoint site using: Connect-PnPOnline -Url $url -Credentials $cred But I am ...
user avatar
0 votes
1 answer
13 views

Can I extract properties to array or object from Measure-PnpWeb?

I am fairly new to PnP PowerShell. I am trying to extract the TotalFileSize property from what the Measure-PnPWeb returns so I can see the total file size from my site. I've tried extracting to client-...
user avatar
0 votes
0 answers
22 views

Azure Key Vault secret value coming up as null when using powershell type FilePath

I have stored Certificate password in a key vault as secret along with client id and certificate 64 base encode. However I am now having trouble using those value in my ps1 script. I am using this in ...
user avatar
0 votes
1 answer
111 views

Connect-PnPonline using certificate

I have created a azure release pipeline. In order for that to work I have made app registration and created certificate. The method I am using to connect right now is as following: Connect-PnPOnline -...
user avatar
0 votes
1 answer
80 views

Connect-PnPOnline Fails in Azure functions when connecting to SharePoint Online

In our Azure functions, we have powershell scripts that connect to SharePoint online and give monthly reports. Recently, we discovered that connect-pnponline is fail to connect to SharePoint after ...
user avatar
  • 101
0 votes
1 answer
66 views

Create List/Doc Library from existing Custom Template (STP) in SubSite with PnP Powershell

I need to create a Document Library that is based on a custom template (.stp) that is already saved in the Site Collection level (..._catalogs/lt/Forms/AllItems.aspx) in the Template Gallery. The ...
user avatar
  • 103
0 votes
1 answer
35 views

PowerShell batch

I am reading data from CSV which is having 10000 items and creating on SharePoint list items. I want to put that in batch using pnp PowerShell. Some one suggest me batch functionality how to use?
user avatar
  • 77
0 votes
1 answer
14 views

update self lookup using pnp poweshell

I have a lookup column in my SharePoint online list. It is having a self lookup of the Yes/No column. my parent field is a Yes/No column and it is connected with a self lookup of another field in my ...
user avatar
  • 77
0 votes
1 answer
99 views

Some PnP cmdlets not being found

We are running PnP PowerShell scripts against SharePoint Online and have had a snag with some of the cmdlets from the PnP library where some of them are not being found (as if they have been removed ...
user avatar
  • 103
0 votes
1 answer
170 views

Connect-PnPOnline : AADSTS50126: Error validating credentials due to invalid username or password

I have multi-factor authentication activated for my SharePoint Tenant. I am trying to connect to one of a site via release pipeline in Azure DevOps. I googled a bit and found that it might be possible ...
user avatar
0 votes
1 answer
43 views

get correct modified date of version history by PowerShell

I'm trying to get modified date from version history by PowerShell, with Sharepoint Online. Using PnP, I did $Ctx = Get-PnPContext $Item = Get-PnPListItem -List "Documents" -Id xxxxx $File = ...
user avatar
  • 1
0 votes
0 answers
17 views

word Custom Property update to Sharepoint Document Library Meta data

There is document having Custom property, I need to update custom property to SharePoint Document Library meta data
user avatar
  • 1
1 vote
2 answers
79 views

How can I get all site collections and sub-sites inside a PowerShell script?

I am building a PowerShell script to loop through all site collections and their sub-sites to get all users who are defined inside the related site owner group. Currently, I have this script where I ...
user avatar
  • 2,224
0 votes
0 answers
60 views

Creating a brand new SharePoint page using PowerShell "Add-PnPFile" command

I can create a file called TestAspx.aspx in Notepad with the following content: <html> <body> This is <b>Awesome!</b> </body> </html> I can then upload it ...
user avatar
0 votes
1 answer
114 views

Get-PnPSiteTemplate to get out the xml for Files

There are files stored in my sites which I would like to take xml out of so when I run invoke it will upload those files to another site. But I can only get files sometimes when I use Get-...
user avatar
0 votes
0 answers
52 views

How to copy a onenote notebook powershell

I wanted to copy a onenote notebook from one sharepoint site and post it to the other sharepoint site . it is located in the site assets folder i want to use powershell either graph api or ...
user avatar
0 votes
1 answer
46 views

XML file doesn't contian reference to Sharepoint collapsible sections

I have been using Get-PnPSiteTemplate -Out C:\file.xml -IncludeAllClientSidePages to get the xml out but I have noticed that the pages which contains collapsible section doesn't collapsible when I ...
user avatar
0 votes
1 answer
41 views

Set a link to a pnp term

i want to use poswershell to add a link to a sub term
user avatar
0 votes
1 answer
37 views

What is meant by Computed column? can we modify it?

I am working on a client SharePoint online tenant, and they have a column of type Computed, as follow:- where users' submit answers from a Power app and the field will either show Passed or Failed.. ...
user avatar
0 votes
1 answer
43 views

Sharepoint 2019 (onpremise) app-only connection thru powershell

i was able to create an app-only sharepoint (version 2019 on premise) by following this guide https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azureacs . I don't find ...
user avatar
0 votes
1 answer
53 views

Add-PSSnapin not working

I'm using the cmdlet Get-SPWeb in my script but not working so I used Add-PSSnapin Microsoft.Sharepoint.Powershell to resolve the problem. Eventhough I still get an error when I use Add-PSSnapin ...
user avatar
1 vote
0 answers
30 views

How to get SharePoint user login name of user not a member of any site

I wanted to get the login name of all users and groups. I can only find ways to get users login names if a user is a member of some site, But I need data for each user and group which can be able to ...
user avatar
0 votes
1 answer
93 views

Im getting the error message - get-pnpsitetemplate : server relative urls must start with spweb.serverrelativeurl

I have used PowerShell many times to export a SharePoint site and load to a new site. However I am now getting the following error message: get-pnpsitetemplate : server relative urls must start with ...
user avatar
0 votes
0 answers
22 views

Document library with only owner access using PnP PowerShell

Using PnP PowerShell, I would like to create an extra document library in SharePoint Online, where only the owner group has access. With the script below I am able to remove all groups I want to ...
user avatar
  • 323
0 votes
0 answers
195 views

Get-PnPSiteTemplate -Out template.xml -Handlers Lists not getting out the Events list

I have event calendar which has events on it. I want to take this list out and upload it to another site of mine. I wanted to use the Get-PnPSiteTemplate -Out template.xml -Handlers Lists to get this ...
user avatar
1 vote
2 answers
260 views

SharePoint find and delete file

A cyber attack generated thousands of files in SharePoint with this name "Read_me_now.htm". In PowerShell with the command Find-PnPFile -Match * read_me_now.htm * I display them. With what ...
user avatar
0 votes
1 answer
111 views

Get JSON file contents into PnP PowerShell variable

I am generating a web page in SharePoint Online with some web parts, using PnP PowerShell. Now I am trying to set up a Highlighted Contents web part, that should display all documents in the site ...
user avatar
  • 323
0 votes
0 answers
45 views

Get all Libraries With No Retention Label

I need a help with PowerShell to generate a report with list of all the Libraries With No Retention Label from the SharePoint tenant Does anyone have a script Is there any way to loop this to all the ...
user avatar
0 votes
1 answer
100 views

Set-PnPSearchSettings Access is denied error

I am trying to update placeholder text of a search box using Set-PnPSearchSettings -Scope Site -SearchBoxPlaceholderText "My search" but it is giving me ...
user avatar
0 votes
1 answer
240 views

PnP PowerShell: Copying to _cts folder with Add-PnPFile gives "Access denied"

I am creating a PnP PowerShell script to set up sites automatically in SharePoint Online. The final part of it is about deploying document templates to the content types that we are using. Having the ...
user avatar
  • 323
0 votes
1 answer
63 views

Apply Microsoft-provided site template to a site with PowerShell

Microsoft published an update MC294082, which says "Now you have the choice to use SharePoint PowerShell cmdlets to decide which Microsoft-provided site templates will be displayed or hidden when ...
user avatar
0 votes
0 answers
35 views

Add managed meta data field with PnP throws error "Object reference not set"

I'm trying to add a managed meta data field to a list in my subsite in SharePoint on-prem with PnP PowerShell. The code gets the managed meta data field and then adds it to the list. ...
user avatar
  • 143
0 votes
1 answer
259 views

Convert .xls file to .xlsx format in SharePoint using PowerShell

I have .xls files (Eg: Book.xls) available in my SharePoint Online folder (https://.sharepoint.com/sites/test/Shared%20Documents/Book.xls"). I want to convert them to .xlsx format (Eg: Book.xlsx) ...
user avatar
  • 1
1 vote
1 answer
40 views

SharePoint Online : search configuration

I've been trying to do do some cleanup in my search config as I made many tests on my tenant and I can't find a way to : delete a ResultSource (added via searchadmin/EditResultSource.aspx) cleanup ...
user avatar
1 vote
1 answer
524 views

- DisableCustomAppAuthentication Parameter not found on Sharepoint Command set-spotenant -DisableCustomAppAuthentication $false

I want to enable custom app authentication by disabling the tenant property -DisableCustomAppAuthentication on SharePoint online I have tried the below commands but I am getting error parameter not ...
user avatar
0 votes
1 answer
32 views

Get the number of downloads/views in SP online document library

I want to get a report for a duration where I need below details for all the files in a document library. Any suggestions on OOB or PowerShell or any other way? Date & Time User details
user avatar
  • 109
0 votes
1 answer
89 views

generate a list of all the AD users nested with in a sharepoint group in sharepoint online using powershell

I need to generate a matrix report of permissions for all the users with AD groups and SharePoint groups for a site collection in SharePoint online.
user avatar
  • 1
0 votes
2 answers
53 views

Test for broken links in .url files

We need to test for broken links in SharePoint Document libaries (.url files). Using powershell, we are able to connect to the library, download the link files, parse them and then test the actual ...
user avatar

1
2 3 4 5
14