AADSTS700016: Application with identifier [Id] was not found in the directory [Company]

Emmanuel Adegor
2 min readSep 13, 2024

--

Credit: google.com

If you’re like me, or you’re reading this, chances are you’ve encountered Microsoft’s latest PnP issue (September 2024).

Before September 9th, 2024, I could easily connect to a SharePoint tenant using the PnP command:

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

This would pop up a Microsoft login page, where I’d enter my email and password (with at least SharePoint Admin access) to establish the connection. Simple, right? But as of September 9th, I started receiving the dreaded error:

AADSTS700016: Application with identifier [Id] was not found in the directory [Company].

After several hours of troubleshooting, I discovered that Microsoft had made a significant change to PnP, which is now reflected in their announcement on the PnP site:

“It has always been a recommended practice to register your own Entra ID Application to use with PnP PowerShell. As of September 9th, 2024, this has become a mandatory step.”

Ref: https://pnp.github.io/powershell/articles/registerapplication.html#manually-create-an-app-registration-for-interactive-login

This update was frustrating, but luckily, there’s now a documented way to connect using the new method. In this post, I’ll guide you through the easiest way to do this. It involves registering an Entra ID Application and using a client ID and secret, meaning you no longer need to rely on email and password authentication in PowerShell.

Credit: google.com

Here’s How You Can Do It:

Step 1: Head over to the PnP blog to learn how to create an App Registration from Entra in Azure. You’ll retrieve the client ID of the app and create a client secret.

Step 2: Copy the client ID and secret generated in Step 1.

Step 3: Then head back to powershell to use the new command:

Connect-PnPOnline -Url $TenantURL -ClientId $ClientID -ClientSecret $ClientSecret

That’s it — simple and easy 😉.

If you’d like more detailed steps or screenshots of how I completed the process from start to finish, feel free to drop a comment below. Also, let me know if you encounter any issues or errors along the way! 🕺🏻

--

--

Emmanuel Adegor
Emmanuel Adegor

Written by Emmanuel Adegor

Principal Software Engineer/Architect ( M365 SharePoint | Teams | SPFX ) | AI Agent | Collaboration Platforms | Workflow Automation Expert

No responses yet