AADSTS700016: Application with identifier <Id> was not found in the directory <Company>.

Jairo Javier Baleta Cali 211 Reputation points
2024-09-10T15:02:36.0733333+00:00

Good morning.

I hope you are well.

When trying to connect with:

Connect-PnPOnline -Url "https://name-admin.sharepoint.com" -Interactive

Or with:

Connect-PnPOnline -Url "https://name-admin.sharepoint.com"

It is throwing the error:

AADSTS700016: Application with identifier <Id> was not found in the directory <Company>. 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.

I verified by accessing the URL https://login.microsoftonline.com/common/adminconsent?client_id=your_client_id with the tenant administrator and it throws the same error.

This error started to occur yesterday. It did not occur last week.

How can I solve the incident?

I hope you can help me.

Thank you very much.

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,671 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,497 questions
0 comments No comments
{count} votes

Accepted answer
  1. James Mackenzie 85 Reputation points
    2024-09-10T15:54:23.69+00:00

    Hi Jairo,

    I've been having the exact same issue since today, and came across your post. I've since discovered why we were getting that error message, so thought id let you know in case yours is the same issue.

    We've been using a service account for credentials that in turn was using the PnP Management Shell application in Azure.

    I updated PnP PowerShell module to the latest and it then gave a much better description of the issue when trying to connect:

    As of September 9th, 2024 the option to use the PnP Management Shell app registration for authentication is not available anymore. Refer to https://pnp.github.io/powershell/articles/registerapplication.html on how to register your own application.

    So looks like we'll need to register our own Entra ID Application to use with PnP PowerShell instead.
    And use something like this:

    Connect-PnPOnline -Url $AdminCenterURL -ClientId $ClientID -ClientSecret $ClientSecret
    
    2 people found this answer helpful.

3 additional answers

Sort by: Most helpful
  1. Uwe Braig 0 Reputation points
    2024-09-11T09:27:53.0233333+00:00

    Worked for me.

    The link provided in the error message (https://pnp.github.io/powershell/articles/registerapplication.html) provides detailed explanation and steps that need to be performed.

    Key message here is:

    It has always been a recommended practise to register your own Entra ID Application to use with PnP PowerShell. As of September 9th, 2024, this has become mandatory step. This article will guide you through how to do so.

    You found this answer helpful.

  2. Theo Horsmeier 0 Reputation points
    2024-09-10T15:54:00.8066667+00:00

    For me it occurred today, a few hours ago I had successfully connected with Connect-PnPOnline, but now I get this same error. Same machine, user, etc.

    0 comments No comments

  3. Daniel Jocks 0 Reputation points
    2024-09-11T11:21:16.58+00:00

    having the same issue.

    Do you have any recvommendations?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.