Forum Discussion
AGanesan2140
Sep 02, 2024Copper Contributor
Issue in connecting Azure Ad user api command from PNP online PS script
I have created a Powershell script in Azure function app. Have connected pnponline using Client id and thumbprint by creating an App registration with Graph API. The code is as below.
Connect-PnPOnline -Url $adminSiteUrl -ClientId $clientId -Thumbprint $Thumbprint -Tenant "$($tenantName).onmicrosoft.com"
Write-Information "Connected Pnp online Successful"
$AzureAd = Get-PnPAzureADUser | Select-object Mail,DisplayName,UserPrincipalName
Pnp online script has connected successfully but on executing the last line Get-PnpAzureADUser, i am getting the error as below.
Error:
The provided value for scope User.Read.All is not valid. Client credential flows must have a scope value with /.default suffixed to the resource identifier (application ID URI).
Please help me on this issue.
- __Nicole__Copper ContributorI have the same Issue and I am using the Newest Version pnp 2.12.0