Fix Connect-PnPOnline Certificate Authentication Timeouts on Remote Servers
Question details
The user is experiencing network timeout errors when running PnP PowerShell certificate authentication scripts on a remote server, despite the same script functioning correctly on a local machine.

- Product
- PnP PowerShell
- Device & OS
- not provided
- Scenario
- Establishing a remote connection to SharePoint Online using Connect-PnPOnline with a certificate.
- Observed behavior
- The connection command times out on remote servers due to blocked background telemetry traffic, restricted outbound HTTPS access, or missing proxy configurations.
Ensure you have administrative privileges on the remote server to configure environment variables, modify firewall rules, and manage certificate private key permissions.
Disable PnP PowerShell Update Checks and Telemetry
Turn off the background update checks and telemetry data collection, which are often blocked by remote server firewalls and cause the connection to time out.
By default, PnP PowerShell attempts to contact Microsoft servers for version updates and telemetry collection. On strict remote servers, this outbound traffic is blocked, resulting in a timeout before the actual authentication completes. Using environment variables disables these background checks.
Launch the PowerShell console with administrative rights on your remote server.
Before running your connection script, execute the commands: $env:PNPPOWERSHELL_UPDATECHECK = "off" and $env:PNPPOWERSHELL_DISABLETELEMETRY = "true".
Execute your Connect-PnPOnline command with the required -Url, -ClientId, -Thumbprint, and -Tenant parameters to successfully authenticate.

Verify Proxy Settings and Certificate Permissions
Ensure the remote process has the correct network pathways and local access rights to utilize the authentication certificate.
Need a Lightweight Office Suite for Your IT Environment?
While troubleshooting complex server and PowerShell connection issues, managing your IT documentation shouldn't be a hassle. WPS Office offers a free, lightweight, and highly compatible alternative to Microsoft Office, perfect for system administrators and remote server deployments.
- 1. Visit the Official Website: Navigate to the WPS Office homepage to access the official installer.
- 2. Download the Installer: Click on the free download button tailored for your operating system.
- 3. Install and Organize: Run the lightweight setup and start documenting your IT workflows immediately.

Frequently Asked Questions
Why does my Connect-PnPOnline script work on my local PC but time out on the server?
Local PCs usually have open outbound internet access, while remote servers often have strict firewall rules. PnP PowerShell attempts to send telemetry and check for updates upon connection, which gets blocked on servers, leading to a timeout.
How do I check if my firewall is blocking PnP PowerShell?
You can use the Test-NetConnection command in PowerShell to check connectivity on port 443 to login.microsoftonline.com and your SharePoint tenant URL. If the TCP test fails, the firewall or proxy is blocking the traffic.
Does disabling PnP PowerShell telemetry affect my SharePoint data?
No. Setting $env:PNPPOWERSHELL_DISABLETELEMETRY = "true" only stops the module from sending anonymous usage statistics to Microsoft. It does not affect the functionality of your script or your SharePoint data.
What if my certificate private key is not accessible?
If the account running the PowerShell script lacks read access to the private key, the authentication will silently fail or time out. You must grant Read permissions via the Certificate Manager (certlm.msc) to the specific user or service account.




