Forum Discussion
PowerShell 7 PnP.PowerShell Header Issue
I am trying to connect to the PnPOnline module using PS7.
I am running PowerShell version 7.6.0 (Core), PnP.PowerShell PSEdition Core, and have my PnP PowerShell App registered in Azure
I have my top level site as the $siteURL variable, my ClientID number as the $clientID variable and the ClientSecret value as the $clientSecret variable... When using the command Connect-PnPOnline -Url $siteUrl -ClientId $clientId -ClientSecret $clientSecret the following is returned:
WARNING:
Connecting with Client Secret uses legacy authentication and provides limited functionality. We can for instance
not execute requests towards the Microsoft Graph, which limits cmdlets related to Microsoft Teams, Microsoft
Planner, Microsoft Flow and Microsoft 365 Groups. You can hide this warning by using Connect-PnPOnline [your
parameters] -WarningAction Ignore
Connect-PnPOnline: The given header was not found.
I have double checked my variables, and all components and still receiving this error. I know there is a certificate method for the App Registration, but what else need to happen to make my connection successful? Or should I go the certificate route for the App Registration?
1 Reply
- Chirayu1988Copper Contributor
Hi.
Just to note — connecting with a Client Secret relies on legacy authentication, which limits available functionality. For example, it prevents us from executing requests against Microsoft Graph, which means features related to Microsoft Teams, Planner, Power Automate (Flow), and Microsoft 365 Groups will not work when using this method.However, for full functionality and modern authentication support, it’s recommended to switch to an authentication method that supports Microsoft Graph