pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets
https://pnp.github.io/powershell
Other
985 stars 665 forks source link

Connecting with App Registration certificate in GCC issues #2958

Open jessierobbins opened 3 years ago

jessierobbins commented 3 years ago

Reporting an Issue or Missing Feature

GCC environment Get-PnPWeb command fails after using ClientId, Tenant, and Thumbprint flags with Connect-PnPOnline. The exact same commands with the same certificate and app registration set up works fine in a commercial tenant.

Expected behavior

Being able to connect to the site successfully to pull data using the Azure App Registration authentication.

Actual behavior

I have my $ErrorActionPreference set to Stop and am outputting the Exception message to a log file - this is what's coming through in my log files. 12/10/2020 14:21:00:588 PM - Access denied. You do not have permission to perform this action or access this resource.

Steps to reproduce behavior

Please include complete code samples in-line or linked from gists

# Connect to SharePoint site
Connect-PnPOnline -Url $site.URL -ClientId $clientId -Tenant $tenant -Thumbprint $thumbprint
$web = Get-PnPWeb -Includes RoleAssignments

Which version of the PnP-PowerShell Cmdlets are you using?

What is the version of the Cmdlet module you are running?

3.26.2010.0 <- Current running 3.25.2009.1 <- Also tested using this one (you can retrieve this by executing Get-Module -Name sharepointpnppowershell* -ListAvailable)

How did you install the PnP-PowerShell Cmdlets?

ghost commented 3 years ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.