Questions tagged [pnp.powershell]

17 questions
1
vote
1 answer

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 returns all any folders in the library too. Is…
dev123
  • 25
  • 1
  • 9
1
vote
1 answer

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 -TargetType Groups -TargetObjectId…
0
votes
2 answers

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 "yourname@domain.com" -Password (Read-Host -AsSecureString -Prompt "Enter…
0
votes
1 answer

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 not working anymore, but just the ones coming…
0
votes
0 answers

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 the Get-PnPTenant it is giving the following…
0
votes
1 answer

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 site through the SharePoint admin centre Run the…
dev123
  • 25
  • 1
  • 9
0
votes
0 answers

VSCode loads old DLL (System.IdentityModel.Tokens.Jwt) on startup

i am developing a powershell cmdlet with microsoft.graph and pnp.powershell. When vscode starts an older version of the dll is loaded by microsoft.graph.authentication. PnP.powershell needs a newer version of this dll and cannot load it because the…
0
votes
0 answers

Deprecate term in SharePoint Online Term Store not working

I'm trying to deprecate some terms based on the guid using PnP PowerShell. The command executes without error but I don't see the term deprecated in the term store. I'm using Set-PnPTerm. $t_group = "People" $t_set = "Department" $t_Id =…
0
votes
0 answers

SharePoint Getting errors: "Version conflict" or "The file XXX has been modified by YYY on ZZZ date and time"

SharePoint Problem: For a library created with Versioning Settings set to No Versions For folders created with Add-PnPFolder, when some (it's intermittent) of the folders are later modified with Set-PnPListItem or Set-PnPListItemPermission: One of…
0
votes
1 answer

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 parameter. It looks like this is something that is…
0
votes
0 answers

Can't get SharePoint Administrators Group using Set-SPOUser

I want to get SharePoint Administrators Group using Get-SPOUser. I verified it. As a result, I was able to get SharePoint Administrators Group in a certain Tenant. But I was not able to get SharePoint Administrators Group in a other…
0
votes
1 answer

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…
dev123
  • 25
  • 1
  • 9
0
votes
1 answer

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 error. The script has an initial connection…
0
votes
0 answers

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 -Url $url -AccessToken $access_token…
Aleksey
  • 179
  • 1
  • 1
  • 13
0
votes
1 answer

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 Receiver using the Connect-PnPOnline with the…
piercove
  • 811
  • 9
  • 17
1
2