How to Install the PnP PowerShell Module for SharePoint Online?

The new PnP PowerShell module PnP.PowerShell is a cross-platform product that can run on any operating system that supports .net core, like Windows, Linux, Mac, etc. and provides 500+ cmdlets to work with Microsoft 365 environment (No support for On-Premises server products, BTW!) cloud products like SharePoint Online, Microsoft Teams, Microsoft Planner, and Microsoft Flow. To install the new PnP PowerShell module, You have to follow these steps:

  1. Uninstall the Legacy SharePointPnPPowerShellOnline Module if installed already.
  2. Install the New PnP PowerShell Module.
  3. Register Azure AD Application and Grant Access to the tenant.

Let’s get started! Open the Windows PowerShell console as an Administrator and execute these steps to install PnP.PowerShell module.

install pnp powershell sharepoint online

Step 1: Uninstall the Legacy SharePointPnPPowerShellOnline Module

Uninstall Any previous PnP PowerShell Modules for SharePoint Online installed.

Uninstall-Module SharePointPnPPowerShellOnline -Force –AllVersions

Step 2: Install the New PnP PowerShell Module

Install the new PnP PowerShell module using:

Install-Module PnP.PowerShell

If needed, You can also Download the PnP PowerShell Offline Installation package and install it with:

Install-Package C:\Path\File.nupkg

Step 3: Register a new Azure AD Application and Grant Access to the tenant


The final step is to grant access to the tenant for the PnP Management Shell Multi-Tenant Azure AD Application. On executing the above cmdlet, you’ll be prompted to log in and provide consent for your tenant. You must log in as a Global Admin (or Tenant Administrator) and complete this step.

add permission to PnP Management Shell

In case you are not a global admin, use: Register-PnPManagementShellAccess -ShowConsentUrl and share the URL you get from this cmdlet with the Tenant Admin, and they can complete this consent step from the URL you share.

Finally, You can verify the installation with:

Get-Command -Module PnP.Powershell

Connect SharePoint Online site using PnP PowerShell

Once you are done with the above steps, You can connect to SharePoint Online through PnP PowerShell as:

#Connect to PnP Online
Connect-PnPOnline -Url "" -Credential (Get-Credential)

#Get All Lists

Connect-PnPOnline using MFA:

To connect to SharePoint Online using PnP PowerShell MFA: Use the “-Interactive” switch instead of “Credentials” if your account is MFA enabled.

#Connect to PnP Online
Connect-PnPOnline -Url "" -Interactive

#Get All Lists

Update PnP PowerShell for SharePoint Online

To update the PnP PowerShell, run:

Update-Module -Name "PnP.PowerShell"

Uninstall PnP PowerShell Module

If you would like to remove the PnP PowerShell, you can run:

Uninstall-Module -Name "PnP.PowerShell"

If you would like to use the PnP PowerShell module for SharePoint Server (On-Premises), You can install it along with Pnp.PowerShell module as:

Install-Module -Name SharePointPnPPowerShell2019 –AllowClobber

This script installs the SharePointPnPPowerShell2019 module and makes cmdlets available from this module. You can use “Import-Module SharePointPnPPowerShell2019” at the first line to instruct your script to load and use Cmdlets from this specific module.

As a side note, the old SharePointPnPPowerShellOnline module is archived and no longer updated.

Salaudeen Rajack

Salaudeen Rajack is a SharePoint Architect with Two decades of SharePoint Experience. He loves sharing his knowledge and experiences with the SharePoint community, through his real-world articles!

Leave a Reply