MC888036 PnP PowerShell authentication failures
Primary service: Entra
ChangePilot summary
- PnP PowerShell, an open-source tool, is experiencing issues affecting user scripts due to a recent change.
- Users receiving a specific error must create their own Entra application in their tenant to resolve authentication issues.
- Steps include ensuring the latest PnP PowerShell version, creating the Entra application, and setting an environment variable with the application ID.
- This change has a significant impact on both users and administrators, requiring action to prevent service disruptions.
- Microsoft does not provide direct support for PnP PowerShell; assistance is available through community resources.
History
Recorded changes
No changes recorded since ChangePilot first saw this post.
Microsoft message
PnP PowerShell is a community provided open-source tool which does not have direct support from Microsoft.
Microsoft 365 customers have provided feedback that a recent change with PnP PowerShell is impacting their scripts.
Although PnP PowerShell is not directly supported by Microsoft, we are providing this information in an effort to help customers address the change.
If you are authenticating your PnP PowerShell sessions and seeing below error, then you are using the PnP Management Shell app (id = 31359c7f-bd7e-475c-86db-fdb8c937548e) and you will need to set up your own Entra application in your own tenant.
Message: AADSTS700016: Application with identifier '31359c7f-bd7e-475c-86db-fdb8c937548e' was not
found in the directory 'The [companyname]'.
This can happen if the application has not been installed by the administrator
of the tenant or consented to by any user in the tenant.
You may have sent your authentication request to the wrong tenant.
Resolution steps
- Ensure you’re using the latest PnP PowerShell version
- Create your own Entra application and assign it the minimal permissions that you would require. This can be done using PnP PowerShell or manually in Entra admin center
- Add an environment variable named ENTRAID_APP_ID with as value the application id of the application created in previous step
More details on how to use PnP PowerShell to set up a new Entra application or how to do this manually are described here: https://github.com/pnp/powershell/issues/4250.
Note that PnP PowerShell is a community powered open-source solution which does not receive official support from Microsoft. The community behind this project is providing best effort support via the issue list and discussion forum in the PnP PowerShell GitHub repository.
More information
- github.com/pnp/powershell
- github.com/pnp/powershell/discussions
- github.com/pnp/powershell/issues
- github.com/pnp/powershell/issues/4250
- pnp.github.io/powershell/articles/defaultclientid.html#by-setting-an-environment-variable
- pnp.github.io/powershell/articles/registerapplication.html#automatically-create-an-app-registration-for-interactive-login
- pnp.github.io/powershell/articles/registerapplication.html#manually-create-an-app-registration-for-interactive-login
- pnp.github.io/powershell/articles/installation.html#stable-build-1
Details
Services
- Entra
- OneDrive
- Power Apps
- SharePoint
- Teams
Category
- Prevent or fix issues
Microsoft tags
- User Adoption
- Admin Action