The process of building custom applications and tools that interact with Microsoft SharePoint, including SharePoint Online in Microsoft 365.
Hi @James,
Have you set the environment variable for client id? Connects to the Azure AD, acquires an access token and allows PnP PowerShell to access both SharePoint and the Microsoft Graph. You will have to register your own App first, by means of Register-PnPEntraIDApp to use this method. You will also have to provide the -ClientId parameter starting September 9, 2024. Alternatively, create an environment variable, call it ENTRAID_APP_ID or ENTRAID_CLIENT_ID and set the value to the app id you created. If you use -Interactive and this environment variable is present you will not have to use -ClientId. You could refer to following
Connect-PnPOnline -Url "https://contoso.sharepoint.com" -Interactive -ClientId 6c5c98c7-e05a-4a0f-bcfa-0cfc65aa1f28
Here is the document for more details
https://pnp.github.io/powershell/cmdlets/Connect-PnPOnline.html
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.