Get-PnPWeb -Includes RoleAssignments - Access denied #483
Unanswered
MP03online
asked this question in
Q&A
Replies: 2 comments 1 reply
-
I'm also encountering this issue, but only on a GCC tenant. The only work around I've found so far is to connect to PnP using the PnP Management Shell Multi-Tenant Azure AD Application, but that would require opening up a lot of access to PnP that I would like to avoid. Does anyone know the exact API permission that is required to query role assignments? Running Get-PnPWeb without "-Includes RoleAssignments" does not throw an error. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Management shell does not give any permissions. They are all delegate permissions, not application permissions Kind regards Anders Rask On 1 Jul 2021 19.58, pmcopeland ***@***.***> wrote:
I'm also encountering this issue, but only on a GCC tenant. The only work around I've found so far is to connect to PnP using the PnP Management Shell Multi-Tenant Azure AD Application, but that would require opening up a lot of access to PnP that I would like to avoid.
Does anyone know the exact API permission that is required to query role assignments? Running Get-PnPWeb without "-Includes RoleAssignments" does not throw an error.
—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or unsubscribe.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I was using the legacy PnP Powershell (SharePointPnPPowerShellOnline) and my code has always worked, but when using the new cross-platform Pnp Powershell (PnP.PowerShell), the following code does not allow me to access the RoleAssigments property in the current web.
$web = Get-PnPWeb -Includes RoleAssignments
Get-PnPWeb : Access denied. You do not have permission to perform this action or access this resource.
At line:1 char:8
I also tried getting the current web without the roleassignments property (which worked) then attempting.
$roleAssignments = Get-PnPProperty -Property RoleAssignments -ClientObject $web
Get-PnPProperty : Access denied. You do not have permission to perform this action or access this resource.
At line:1 char:20
Beta Was this translation helpful? Give feedback.
All reactions