Admin Console no longer works. New apps give access denied. Get-PnPAzureADAppSitePermission not working. #4351
-
I'm lost and now I have no idea how to get out of this mess. First Admin Console stopped working. Now I build an app and has all rights. I used Register-PnPEntraIDApp I get app registered so I can 'admin' again. I connect with certificate and clientid. I can list sites. I run Get-PnPAzureADAppSitePermission I get access denied. |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 7 replies
-
I keep getting stuck in a loop and trying to work through the hobbling of the admin console setup. I've spent about 10 hours now working through this mess and I'm just stuck. Why don't permissions work? Do I have to connect a special way? Is there a switch I'm missing? What is going on? This used to work and now I can't get anything to really work properly. |
Beta Was this translation helpful? Give feedback.
-
I'm not exactly sure what your issue is, but if you look at the documentation for Get-PnPAzureADAppSitePermission, you'll see you need: Microsoft Graph API: Sites.FullControl.All Check your app permissions and make sure you've consented to that under API permssions. |
Beta Was this translation helpful? Give feedback.
-
The old shared app registration granted a LOT of consent - more than many of us needed. This article from fellow MVP Paul Bullock shows all the permissions the old app had: What permissions the PnP Management Shell app had in the past? | pkbullock.com Now, when you want to use specific cmdlets, you need to just make sure you've consented to those permissions for the app registration you've set up. for Grant-PnPAzureADAppSitePermission you need: Microsoft Graph API: Sites.FullControl.All, just as you needed for Get-PnPAzureADAppSitePermission above. Once you've granted consent for a specific API permission, it's available to anyone using that app registration. (In theory, you could have different app registrations for different needs, but that's a next level topic.) Because the permissions are delegated, the person running the script also has to have permissions on the objects which the cmdlet interacts with. Right now, you can read information about sites with Get-PnPSite because you've consented to SharePoint: Sites.FullControl.All. |
Beta Was this translation helpful? Give feedback.
-
You should be consenting to the API permissions for the app registration you created for PnP.PowerShell. I'm not sure what you mean by the "admin console". You grant the permissions in Entra ID. |
Beta Was this translation helpful? Give feedback.
-
I have no clue how to get Grant-PnPEntraIDAppSitePermission to work. |
Beta Was this translation helpful? Give feedback.
-
Something about Access tokens now.... |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
The old shared app registration granted a LOT of consent - more than many of us needed. This article from fellow MVP Paul Bullock shows all the permissions the old app had: What permissions the PnP Management Shell app had in the past? | pkbullock.com
Now, when you want to use specific cmdlets, you need to just make sure you've consented to those permissions for the app registration you've set up. for Grant-PnPAzureADAppSitePermission you need: Microsoft Graph API: Sites.FullControl.All, just as you needed for Get-PnPAzureADAppSitePermission above.
Once you've granted consent for a specific API permission, it's available to anyone using that app registration. (In theory, you could have di…