Hi @john john ,
According to my research and testing, I can use Get-PnPList
successfully ,here is my test result:
As a troubleshooting, please follow this checklist to check Executequery 403 forbidden error in SharePoint Online PowerShell:
- You may have provided the credentials of another tenant, which would end up with this error message (Happens when working with multiple tenants!) So make sure the URL and credentials are correct.
- You may be missing the SharePoint Online Client Component SDK on your client computer. Make sure you have the latest version installed and the referenced DLL paths are correct.
- You may be attempting to access a site that you don’t have access to! Verify your access to the site by browsing to it. Having Tenant Admin or SharePoint Online Administrator roles doesn’t gain your access to SharePoint sites automatically. You have to add yourself to the site explicitly: How to Add Site collection Administrator to SharePoint Online using PowerShell?
- The site may be in locked state! You can check the lock status and unlock: How to Lock/Unlock Sites in SharePoint Online?
- You may need to be in your organization network with a compliant device as per the conditional access policies of your tenant.
- The credential you pass must be of type “SharePointOnlineCredentials”.
More information for reference: SharePoint Online: Fix “The remote server returned an error: (403) Forbidden.” Error in PowerShell
Hope it can help you. Thanks for your understanding.
Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.
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.