Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Filter by
Sorted by
Tagged with
0 votes
0 answers
54 views

Using Add-PnpFile, i can't update the "Modified" property of the uploaded file

I have created a script to upload files to a library in SharePoint, using PnP.Powershell (last version : 3.1.0), with PowerShell 7.5.2 (I had the same problem with Powershell 7.4). I'm trying to ...
Olivier Gouret's user avatar
0 votes
0 answers
83 views

Minimal permissions in Graph for app to share file with PNP PowerShell

I try to create an app to upload files to a SharePoint library and then share the file with an external user. But I want the app to have the minimalistic permissions possible. Everything is working as ...
itsecharry's user avatar
0 votes
0 answers
73 views

PnP.PowerShell not working when running as scheduled-task

I want to automate some SharePoint-related tasks via PnP.PowerShell. The script itself is done and works fine if I run it manually. But If I run it via task scheduler it only works with the setting &...
GuidoT's user avatar
  • 322
0 votes
1 answer
3k views

Access and Modify SharePoint Online list using PnP.Powershell and AccessTokens / Registered App

With Microsoft's changes away from user/password authentication, I'm trying to update a script to use a registered app but having trouble accessing the SharePoint Online list and getting a 401 ...
Ahren Bader-Jarvis's user avatar
0 votes
1 answer
126 views

Use Column Formatting in a custom column in OneDrive for Business

We are trying to create a custom column in the users' OneDrives to display some information reflecting applied retention labels. We achieved to create the colum through PnP.PowerShell and also apply ...
Uwe Grohne's user avatar
0 votes
1 answer
562 views

Get-PnPSiteTemplate gets stuck for a long time on certain handlers

I'll preface this by saying I'm very new to SharePoint and to PowerShell, so please bear with me and I'm happy to edit the question or provide more information as needed! Not sure if this context ...
Rachel Piotraschke Organist's user avatar
0 votes
0 answers
2k views

Error: "Attempted to perform an unauthorized operation" with Get-PnPFile in SharePoint Online

I'm encountering an issue with the Get-PnPFile cmdlet in SharePoint Online PowerShell. Despite being the site collection owner and having list permissions enabled, I consistently receive the following ...
Agni200895's user avatar
0 votes
1 answer
556 views

How to interact with PnPListItem ContentType

If you run a command like this, it should pull some information about the ContentType of the List Items. $x = Get-PnPListItem -List $list -PageSize 100 -Fields Title -IncludeContentType Indeed it ...
Craig.C's user avatar
  • 621
2 votes
2 answers
4k views

Connect-MgGraph cmdlet throws different errors in PowerShell 5.1 and 7.4

I have a PowerShell script that connects to Microsoft.Graph through certificate based authentication Connect-MgGraph -ClientId "XXXXXX" -TenantId "XXXXX" -CertificateThumbprint &...
RobJose's user avatar
  • 27
0 votes
3 answers
1k views

PnP PowerShell: Bad Request when attempting to create a PnPAzureAD App

When running the following command on PowerShell 7.2: Register-PnPAzureADApp -ApplicationName TestApp -Tenant yourtenant.onmicrosoft.com -Store CurrentUser -Username "[email protected]" -...
Justin Lyon's user avatar
0 votes
1 answer
137 views

VB .NET hosted powershell not running module cmdlets

I have a VB.NET 2015 Ent app that created a couple years ago on Win 10, among other things it runs powershell commands, I got a new computer (win 11), I've set everything up but the shell commands are ...
Oscar Marquez's user avatar
0 votes
0 answers
758 views

Get-PnPTenant is throwing unauthorized error

We are using the Connect-PnPOnline, to connect with sharepoint using the CBA(application Id and secret). And the app has the necessary permissions and SharePoint admin role too. image While running ...
Ananda Bhavani Gedela's user avatar
0 votes
2 answers
737 views

Why does using the PnP.PowerShell cmdlet Enable-PnPFeature to enable multilingual support add all languages on a SharePoint site?

So this is driving me crazy! Please help :) I'm using the PnP.PowerShell module to enable multi-lingual support on a SharePoint Online site. I'm taking the following steps. Create a communication ...
dev123's user avatar
  • 25
0 votes
1 answer
563 views

Missing -connection parameter in Connect-PnPOnline

The current Connect-PnPOnline documentation lists a -Connection parameter: https://pnp.github.io/powershell/cmdlets/Connect-PnPOnline.html#-connection but in PnP.PowerShell v1.12.0 I can't see that ...
MubSalim's user avatar
0 votes
1 answer
1k views

Set-PnPListItem Column '{my column name}' does not exist. It may have been deleted by another user

Something is wacky with my SharePoint list. When I use Get-PnPListItem -List $listTitle -ID $id It returns only 3 columns: Id, Title, and GUID. Likewise, when I try to use Get-PnPListItem I only ...
n8.'s user avatar
  • 1,744
1 vote
1 answer
3k views

PnP - PowerShell - SharePoint - Getting all files in a library but omitting folder items

I'm using the PnP PowerShell module to interact with SharePoint lists/libraries. I'm running the following cmdlet to get a list of all the files in a library. This is working perfectly, except it ...
dev123's user avatar
  • 25
0 votes
2 answers
1k views

PnP - Powershell - Purview - Sensitivity labels - Unable to get results from Get-PnPAvailableSensitivityLabel - Access Denied

I'm using PnP Powershell module to call 'Get-PnPAvailableSensitivityLabel'. This cmdlet allows retrieval of the available Microsoft Purview sensitivity labels in the currently connected tenant (https:...
dev123's user avatar
  • 25
1 vote
1 answer
492 views

PowerShell - PnP - Microsoft Groups - Get Guest access setting AllowToAddGuests

I'm using the AzureADPreview module to find out if a group has guest access allowed. This is working fine and returns true/false, script shown below: $groupSettings = Get-AzureADObjectSetting -...
dev123's user avatar
  • 25
0 votes
1 answer
1k views

Connect-PnPOnline gets stuck on UseWebLogin - but only sometimes

We have a script that loops through a CSV input of sites and we don't want to login for every site. Up until a few days ago, it was working fine with the UseWebLogin method, but now we're seeing an ...
Jess's user avatar
  • 1
0 votes
0 answers
4k views

Get-PnPTenantSite : Attempted to perform an unauthorized operation

Currently we get an access token and then pass this token to PowerShell script to loop across all ODFB personal sites. $url = "https://XXXXX-admin.sharepoint.com" $conn = Connect-PnPOnline -...
Aleksey's user avatar
  • 211
0 votes
1 answer
526 views

Add-PnPEventReceiver only works fully when -UseWebLogin parameter is used

I'm using PnP Powershell to add an Event Receiver to a document library. The Event Receiver points to an Azure function. Below is code that I wrote in a local Powershell script that can add an Event ...
piercove's user avatar
  • 811
-1 votes
1 answer
1k views

Trouble with the new PnP.PowerShell module

Using the SharePointPnPPowerShellOnline module, to upload a file, to a specific folder (in a specific site), I used to run commands like this: $cred = Get-Credential Connect-PnPOnline -Url "https:...
StackExchangeGuy's user avatar
1 vote
3 answers
2k views

Azure AD Group and SharePoint

I'm having an issue with the timing around creating a new Azure AD security group and using that group for SharePoint Online folder access. Using New-PnPAzureADGroup i'm creating the security group, ...
Matt Price's user avatar
  • 34.6k