Skip to content

[BUG] Get-PnPCopilotAgent - The attempted operation is prohibited because it exceeds the list view threshold #4798

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 of 6 tasks
robertcaretta opened this issue Mar 18, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@robertcaretta
Copy link

robertcaretta commented Mar 18, 2025

Reporting an Issue or Missing Feature

I am looping over every site in the tenant. This cmdlet is throwing this error on many sites.
By my estimation it is at least 20% of the sites.

Get-PnPCopilotAgent:
Line |
10 | $agents = Get-PnPCopilotAgent -Connection $connection
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| The attempted operation is prohibited because it exceeds the list view threshold.

I also encountered this error on one site.

Get-PnPCopilotAgent:
Line |
7 | $agents = Get-PnPCopilotAgent -Connection $connection
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Value cannot be null. (Parameter 'source')

Expected behavior

No errors.

Actual behavior

Error #1 - Throws an error related to list view threshold.
Error #2 - Throws an error related to Value cannot be null. (Parameter 'source')
Error #3 - Properties don't line up with output. See comment below.

Steps to reproduce behavior

I fetch all sites and assigned to variable $tenantSites. Then loop over them like this...
(Side note, the code formatting in this WYSIWIG editor doesn't work as expected. )

$tenantSites | ForEach-Object {

$connection = Connect-PnPOnline -Url $_.Url -ClientId $gtc.ClientId -Thumbprint $gtc.Certificate.Thumbprint -Tenant $gtc.Tenant -ReturnConnection
$_.Url

$agents = Get-PnPCopilotAgent -Connection $connection

if ($agents.count -ge 1) {
    foreach($agent in $agents) {
      $agent.Name
      $agent.AgentType
      $agent.FileLocation
    }
}

$connection = $null

}

What is the version of the Cmdlet module you are running?

2.99.169

Which operating system/environment are you running PnP PowerShell on?

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify
@robertcaretta robertcaretta added the bug Something isn't working label Mar 18, 2025
@robertcaretta
Copy link
Author

Also these properties don't line up with the output.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant