logo
search
Others

Fix Connect-PnPOnline Certificate Authentication Timeouts on Remote Servers

Nimra MalikNimra Malik Sep 29, 2026 869 views

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.

How to Fix Connect-PnPOnline Certificate Authentication Timeouts on Remote Servers
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.
Before you start

Ensure you have administrative privileges on the remote server to configure environment variables, modify firewall rules, and manage certificate private key permissions.

Solution 1Recommended

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.

1
Open PowerShell as Administrator

Launch the PowerShell console with administrative rights on your remote server.

2
Set Environment Variables

Before running your connection script, execute the commands: $env:PNPPOWERSHELL_UPDATECHECK = "off" and $env:PNPPOWERSHELL_DISABLETELEMETRY = "true".

3
Run Connect-PnPOnline

Execute your Connect-PnPOnline command with the required -Url, -ClientId, -Thumbprint, and -Tenant parameters to successfully authenticate.

Disable PnP PowerShell Update Checks and Telemetry
Connection Optimization: Disabling these environment variables not only prevents timeouts but can also speed up the connection process on restricted networks.
Free Microsoft Office alternative

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. 1. Visit the Official Website: Navigate to the WPS Office homepage to access the official installer.
  2. 2. Download the Installer: Click on the free download button tailored for your operating system.
  3. 3. Install and Organize: Run the lightweight setup and start documenting your IT workflows immediately.
Fully compatible with Microsoft Word, Excel, and PowerPoint formats (.docx, .xlsx, .pptx) for seamless documentation sharing.Lightweight installation package saves valuable disk space and memory resources on remote servers and local workstations.Familiar user interface reduces the learning curve, allowing IT professionals to create technical guides effortlessly.Excellent for keeping logs, network diagrams, and PowerShell script drafts organized in a unified tabbed workspace.
microsoft office alternative - wps office

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.