Thursday, December 2, 2021

SharePoint Online: Temporary fix for error The user or administrator has not consented to use the application with ID named 'PnP Management Shell'

 Hello All,


You will be shocked to see the error The user or administrator has not consented to use the application with ID named 'PnP Management Shell'  after using Connect-PnPOnline cmdlet for SharePoint Online.

There is a temporary solution. 

Solution: Downgrade your PnP module to version 3.20.2004.0

Here's what happened to me.

I got new laptop and setting up my Dev environment. 

- Installed PnP module (latest version)

- Tried connecting SharePoint Online using Connect-PnPOnline

- Got the error The user or administrator has not consented to use the application with ID named 'PnP Management Shell'

- Official solution is to ask admin to approve "PnP Management Shell" app

Seriously !!! Come on. 

As a SharePoint developer, I dont want to request Admins for these things.

PnP was very powerful tool for developers but now ?

Few experts were providing the solution to use Connect-PnPOnline -Url <siteurl> -Interactive . It didn't help.

On the PnP github, someone said that he downgraded the PnP version. 

I tried and it worked. 

Temporary solution

UnInstall-Module -Name "PnP.PowerShell"

Install-Module -Name SharePointPnPPowerShellOnline -RequiredVersion 3.20.2004.0

Sharing is caring. 


0 comments:

Post a Comment