Skip to content

Getuserassignedrights. Fix for bug #5477 - #5509

Open
reshmee011 wants to merge 4 commits into
pnp:devfrom
reshmee011:getuserassignedrights
Open

reshmee011 wants to merge 4 commits into
pnp:devfrom
reshmee011:getuserassignedrights

Conversation

@reshmee011

@reshmee011 reshmee011 commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Type

  • Bug Fix

What is in this Pull Request ?

A try catch while enumerating through list items to see if it helps fixing the issue.

Copilot AI balanced review requested due to automatic review settings November 18, 2026 19:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The catch suppresses connection failures and exhausted retries as warnings, allowing incomplete permissions reports without honoring callers’ -ErrorAction Stop expectations.

1 open issue
What changed in this PR

This PR attempts to address #5477 by allowing Get-PnPUser -WithRightsAssignedDetailed to continue when processing an individual list item fails.

Changes:

  • Wraps per-item permission retrieval in a try/catch.
  • Logs the item, list, site, and exception message as a warning before continuing.
File Description
src/​Commands/​Principals/​GetUser.cs Adds per-item exception handling during detailed permission enumeration.

Review effort: Balanced

}
catch (Exception ex)
{
LogWarning(string.Format("Error while enumerating listitem {0} in list {1} in site {2} with error {3}", listItem.Id, list.RootFolder.ServerRelativeUrl, CurrentWeb.Url, ex.Message));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@reshmee011 - any thoughts on this ? Seems like a valid comment, though am not sure if it might be a breaking change or something ?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants