How to Fix SharePoint 403 Forbidden Errors with PnP PowerShell
Question details
The user needs to resolve an HTTP 403 Forbidden error that occurs when executing commands like Get-PnPWeb after connecting to a SharePoint site using PnP PowerShell.

- Product
- SharePoint
- Device & OS
- not provided
- Scenario
- Running automated scripts or connecting to a SharePoint site via PnP PowerShell to manage site resources and data.
- Observed behavior
- The connection command appears to succeed, but subsequent operations return an HTTP 403 Forbidden error due to multifactor authentication blocks or insufficient application access rights.
Ensure you have the URL of the target SharePoint site and access to a user account with adequate administrative privileges, or access to the Microsoft Entra ID portal to review app permissions.
Authenticate Using Interactive Browser Login
Use this solution if your account has Multifactor Authentication (MFA) enabled, which blocks standard credential-based authentication in PowerShell.
Standard username and password parameters in PnP PowerShell will fail silently or trigger a 403 error when MFA is enforced. Bypassing this requires forcing an interactive web login prompt.
Launch your PowerShell console as an Administrator.
Execute the command using the web login parameter: Connect-PnPOnline -Url "https://yourtenant.sharepoint.com/sites/yoursite" -UseWebLogin
A browser window will appear. Enter your Microsoft 365 credentials and complete any multifactor authentication prompts.
Run the Get-PnPWeb command to verify that the 403 Forbidden error is resolved and site details are returned.

Verify Application and Site.Selected Permissions
Apply this solution if you are authenticating via an Azure AD App Registration (App-Only authentication) rather than a user account.
Streamline Your Document Workflow with WPS Office
While resolving SharePoint server-side permissions requires administrative troubleshooting, editing and collaborating on the documents stored there doesn't have to be complicated. WPS Office provides a lightweight, highly compatible, and free alternative to Microsoft Office, ensuring your team stays productive without software access issues.
- 1. Download the Installer: Visit the official WPS website to download the free suite for Windows, Mac, or Linux.
- 2. Open Your Office Documents: Directly open your .docx, .xlsx, and .pptx files synced from SharePoint without losing any complex formatting.
- 3. Edit and Share Easily: Use the familiar tools to edit your documents offline or collaborate using built-in cloud sharing features.

Frequently Asked Questions
Why does Connect-PnPOnline succeed but Get-PnPWeb returns an HTTP 403 error?
Connect-PnPOnline only verifies your authentication against Azure Active Directory. It does not validate your authorization to the specific site. When Get-PnPWeb attempts to read the site data, SharePoint blocks the request with a 403 error if your account or application lacks the necessary site-level permissions.
Does Multifactor Authentication (MFA) block PnP PowerShell scripts?
Yes, if you use standard credentials (username and password) within your script, MFA policies will block the authentication attempt. You must bypass this by using the -UseWebLogin or -Interactive parameters to trigger a browser-based MFA prompt.
How do I fix PnP PowerShell 403 errors when using app-only authentication?
App-only authentication requires the Azure AD application to be granted explicit SharePoint API permissions. If you are using the principle of least privilege (Sites.Selected), you must also use Microsoft Graph to assign explicit read or write access to the specific target site.




