SharePoint PnP PowerShell examples (Best 25)

In this SharePoint tutorial, we will discuss various SharePoint PnP PowerShell examples. Here we will see the below PnP PowerShell SharePoint examples:

  1. Create modern team site using PnP PowerShell (with Office 365 group)
  2. How to create a modern team site without an office 365 group using PnP PowerShell
  3. PnP PowerShell get all modern team sites
  4. Remove a Modern SharePoint Team Site using PnP PowerShell
  5. How to remove modern SharePoint Team Site (with Site URL) with Force
  6. Remove Modern SharePoint Team Site (with Site URL) from the Recycle Bin
  7. Create a SharePoint Online Communication Site using PnP PowerShell
  8. Get all Communication Site using PnP PowerShell
  9. Delete a Communication Site Using PnP PowerShell
  10. Delete a SharePoint Communication Site (with Site URL) with Force
  11. Delete the SharePoint Communication Site (with Site URL) from the Recycle Bin
  12. Get SharePoint site created date using PnP PowerShell
  13. PnP PowerShell add user to sharepoint group
  14. PnP PowerShell add user as site collection administrator
  15. Get SharePoint Site Collection Administrator using PnP PowerShell
  16. Remove Site Collection Administrator SharePoint Online using PnP PowerShell
  17. How to Get all Site Collections in SharePoint Online Using PnP PowerShell
  18. Get all Sub Sites in SharePoint Online Using PnP PowerShell
  19. Restore SharePoint Online Site Using PnP PowerShell
  20. Create a SharePoint Online List using PnP PowerShell
  21. Check if SharePoint Online List exists or not using PnP PowerShell
  22. How to Remove SharePoint Online List using PnP PowerShell
  23. Remove SharePoint Online List with Force
  24. Remove SharePoint Online List with Recycle bin
  25. Retrieve a SharePoint Online List using PnP PowerShell
  26. How to update SharePoint Online List Title Using PnP PowerShell

If you are new to PnP PowerShell, check out an article on Connect to SharePoint online using pnp PowerShell.

Table of Contents

SharePoint PnP PowerShell Examples

Now, let us see various SharePoint PnP PowerShell examples, especially related to SharePoint sites and lists and libraries. All these PowerShell commands you can run in Windows PowerShell ISE.

SharePoint PnP PowerShell examples
SharePoint PnP PowerShell examples

1. Create modern team site using PnP PowerShell (with Office 365 group)

Now, we will see how to create a SharePoint Online modern team site using PnP PowerShell. This will be an Office 365 group connected team site in SharePoint.

Below is the PowerShell script to create modern team site using pnp powershell.

$userName = "preeti@tenant.onmicrosoft.com"
$passWord = "**********"
$encPassWord = convertto-securestring -String $passWord -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $userName, $encPassWord
Connect-PnPOnline -Url "https://tenant-admin.sharepoint.com/" -Credentials $cred

New-PnPSite -Type TeamSite -Title 'TSInfo Modern Team' -Alias "TSInfoModernTeam" -IsPublic
Write-Host "The modern team site has been created successfully."
create modern team site using pnp powershell
Create a modern team site using pnp PowerShell

Once you run the command, you can see the team site get created which is available in Active sites on SharePoint Online admin center.

create modern team site using powershell
Create a modern team site using pnp PowerShell

2. Create a modern team site without an office 365 group using PnP PowerShell

We can easily create a modern team site without an Office 365 group using PnP PowerShell in SharePoint Online.

$userName = "preeti@tenant.onmicrosoft.com"
$passWord = "**********"
$encPassWord = convertto-securestring -String $passWord -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $userName, $encPassWord
Connect-PnPOnline -Url "https://tenant-admin.sharepoint.com/" -Credentials $cred

New-PnPTenantSite `
  -Title "TSInfo Modern Team Without Group" `
  -Url "https://tenant.sharepoint.com/sites/TSInfoModernTeamWithoutGroup" `
  -Description "Modern Site" `
  -Owner "preeti@tenant.onmicrosoft.com" `
  -Lcid 1033 `
  -Template "STS#3" `
  -TimeZone 10 `
  -Wait
Write-Host "The modern team site without Office 365 Group has been created successfully."
sharepoint create modern team site without group pnp powershell
Create a modern team site without an office 365 group using PnP PowerShell

Once you run the PowerShell cmdlet, you can see in the Active Sites tab, the SharePoint Online team site without an Office 365 group.

create a modern team site without an office 365 group
Create a modern team site without an office 365 group using PnP PowerShell

This is how to create a team site using PnP PowerShell (without an Office 365 group).

3. PnP PowerShell get all modern team sites

Now, we will see how to get all modern team sites in SharePoint Online using PnP PowerShell.

$userName = "preeti@tenant.onmicrosoft.com"
$passWord = "**********"
$encPassWord = convertto-securestring -String $passWord -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $userName, $encPassWord
Connect-PnPOnline -Url "https://tenant-admin.sharepoint.com/" -Credentials $cred

Get-PnPTenantSite -Template GROUP#0
Write-Host "Retrieved all Modern Team Sites."
Retrieve all Modern Team Sites Using PnP PowerShell
get all modern team sites using PowerShell

4. Remove a Modern SharePoint Team Site using PnP PowerShell

Below is the PnP PowerShell command to remove a modern SharePoint Team Site Collection from your Office 365 tenant.

NOTE:

Before removing the Modern Team Site from your office 365 tenant, You must ensure to delete the SharePoint Office 365 Group which will be present with the same existing Modern Team Site name.
$userName = "preeti@tenant.onmicrosoft.com"
$passWord = "**********"
$encPassWord = convertto-securestring -String $passWord -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $userName, $encPassWord
Connect-PnPOnline -Url "https://tenant-admin.sharepoint.com/" -Credentials $cred

Remove-PnPTenantSite -Url https://tenant.sharepoint.com/sites/TSInfoModernTeam
Write-Host "SharePoint Online Team Site is Removed."

Once you will run the above PowerShell script, then a pop-up window will appear to ensure to delete the Modern SharePoint Team Site.

Remove Modern Team Site using PnP PowerShell
delete team site using pnp powershell

When you will click on the Yes button, then the Modern SharePoint Team Site will remove as shown in the below screenshot.

Remove SharePoint Modern Team Site using PnP PowerShell
delete sharepoint team site using pnp powershell

Now when you will go to the SharePoint Deleted sites in the SharePoint Online admin center, you can see the deleted SharePoint Modern Site like below.

Now, you can see the TSInfo Modern Team Site in Deleted sites.

Remove SharePoint Online Modern Team Site using PnP PowerShell
delete team site using pnp powershell

This is how to delete a modern team site using PnP PowerShell.

Check out, SharePoint site owner training.

5. Remove Modern SharePoint Team Site (with Site URL) with Force

This below PnP PowerShell Code will remove the Modern SharePoint Team Site with the Site URL (https://tenant.sharepoint.com/sites/TSInfoModernTeam) with force and it will skip the recycle bin.

Remove-PnPTenantSite -Url https://tenant.sharepoint.com/sites/TSInfoModernTeam -Force -SkipRecycleBin

6. Remove Modern SharePoint Team Site (with Site URL) from the Recycle Bin

This below PnP PowerShell cmdlets will remove the Modern SharePoint Team Site with the Site URL (https://tenant.sharepoint.com/sites/TSInfoModernTeam) from the Recycle bin.

Remove-PnPTenantSite -Url https://tenant.sharepoint.com/sites/TSInfoModernTeam -FromRecycleBin

7. Create a SharePoint Online Communication Site using PnP PowerShell

We can use PnP PowerShell commands to create a SharePoint Online communication site. Below is the PowerShell cmdlets to create a communication site in SharePoint Online.

$userName = "preeti@tenant.onmicrosoft.com"
$passWord = "**********"
$encPassWord = convertto-securestring -String $passWord -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $userName, $encPassWord
Connect-PnPOnline -Url "https://tenant-admin.sharepoint.com/" -Credentials $cred

New-PnPSite -Type CommunicationSite -Title 'TSInfo Communication Site' -Url "https://tenant.sharepoint.com/sites/TSInfoCommunicationSite" -SiteDesign "Showcase"
Write-Host "The communication site has been created successfully.
Create a Communication Site Using PnP PowerShell
Create a Communication Site using PnP PowerShell

If you will check in the SharePoint Online Admin center, you can see the communication sites appears under Active Sites.

create a communication site in sharepoint online powershell
create a communication site in sharepoint online pnp powershell

This is how to create a sharepoint communication site using pnp powershell.

8. Get all Communication Site using PnP PowerShell

Below is the PowerShell script to get all communication sites using pnp powershell from Office 365.

$userName = "preeti@tenant.onmicrosoft.com"
$passWord = "**********"
$encPassWord = convertto-securestring -String $passWord -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $userName, $encPassWord
Connect-PnPOnline -Url "https://tenant-admin.sharepoint.com/" -Credentials $cred

Get-PnPTenantSite -Template SITEPAGEPUBLISHING#0
Write-Host "Retrieved all Communication Sites."
get all communication sites using pnp powershell
Retrieve all Communication Site using PnP PowerShell

This is how to get all communication sites using pnp powershell.

9. Delete a Communication Site Using PnP PowerShell

Below is the PowerShell script to delete a Communication Site from Office 365 tenant using PnP PowerShell.

$userName = "preeti@tenant.onmicrosoft.com"
$passWord = "**********"
$encPassWord = convertto-securestring -String $passWord -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $userName, $encPassWord
Connect-PnPOnline -Url "https://tenant-admin.sharepoint.com/" -Credentials $cred

Remove-PnPTenantSite -Url https://tenant.sharepoint.com/sites/TSInfoCommunicationSite
Write-Host "SharePoint Online Communication Site is Removed."

Once you run the script, a pop-up window will appear to confirm to delete the SharePoint Communication Site.

Delete a Communication Site Using PnP PowerShell

When you will click on the Yes button, then the SharePoint Communication Site will remove as shown in the below screenshot.

Delete a SharePoint Communication Site Using PnP PowerShell
Delete a Communication Site Using PnP PowerShell

Now when you will go to the SharePoint Deleted sites, then you can see your deleted SharePoint Communication Site will be there as like below.

As I have removed the TSInfo Communication Site, So it is showing in my SharePoint Deleted sites page.

Delete SharePoint Communication Site Using PnP PowerShell
Delete a Communication Site Using PnP PowerShell

This is how to delete a communication site using PnP PowerShell in Office 365.

10. Delete a SharePoint Communication Site (with Site URL) with Force

This below PnP PowerShell Code will delete the Communication Site with the Site URL (https://tenant.sharepoint.com/sites/TSInfoCommunicationSite) with force and it will skip the recycle bin.

Remove-PnPTenantSite -Url https://tenant.sharepoint.com/sites/TSInfoCommunicationSite -Force -SkipRecycleBin

11. Delete the SharePoint Communication Site (with Site URL) from the Recycle Bin

This below PnP PowerShell Code will delete the SharePoint Communication Site with the Site URL (https://tenant.sharepoint.com/sites/TSInfoCommunicationSite) from the Recycle bin.

Remove-PnPTenantSite -Url https://tenant.sharepoint.com/sites/TSInfoCommunicationSite -FromRecycleBin

12. Get SharePoint site created date using PnP PowerShell

By using PnP PowerShell cmdlets, we can easily get created date of a SharePoint Online site.

$userName = "preeti@tenant.onmicrosoft.com"
$passWord = "**********"
$encPassWord = convertto-securestring -String $passWord -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $userName, $encPassWord
Connect-PnPOnline -Url "https://tenant.sharepoint.com/sites/tsinfoclassic/" -Credentials $cred

$web=Get-PnPWeb -Includes Created
write-host $web.Created
Get Created Date of SharePoint Online Site Using PnP PowerShell
Get Created Date of SharePoint Online Site Using PnP PowerShell

This is how to get SharePoint Online site created date using PnP PowerShell.

13. PnP PowerShell add user to sharepoint group

Now, we will check how to add user to SharePoint group using PnP PowerShell.

$userName = "preeti@tenant.onmicrosoft.com"
$passWord = "**********"
$encPassWord = convertto-securestring -String $passWord -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $userName, $encPassWord
$siteURL= "https://tenant.sharepoint.com/sites/tsinfoclassic/"
Connect-PnPOnline -Url $siteURL -Credentials $cred

Add-PnPUserToGroup -LoginName Bijay@tenant.onmicrosoft.com -Identity 'TSInfoGroup'
Write-Host "A user is added to the SharePoint Group."
Add User to SharePoint Group Using PnP PowerShell
pnp powershell add user to sharepoint group

Once you run the script, you can see the user to the SharePoint group in the SharePoint Online site.

pnp powershell add user to sharepoint group
pnp powershell add user to sharepoint group

This is how to add user to sharepoint group using pnp powershell.

14. PnP PowerShell add user as site collection administrator

Now, we will see how to add site collection administrator’s to SharePoint Online list using PnP PowerShell.

$userName = "preeti@tenant.onmicrosoft.com"
$passWord = "**********"
$encPassWord = convertto-securestring -String $passWord -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $userName, $encPassWord
Connect-PnPOnline -Url "https://tenant-admin.sharepoint.com/" -Credentials $cred

Add-PnPSiteCollectionAdmin -Owners @("preeti@tenant.onmicrosoft.com", "bijay@tenant.onmicrosoft.com")
Write-Host "Added additional Site Collection Administrator."
pnp powershell add user as site collection administrator
pnp powershell add user as site collection administrator

This is how to add user as site collection administrator using pnp powershell.

15. Get SharePoint Site Collection Administrator using PnP PowerShell

Below is the PowerShell cmdlets to get the site collection administrators using PnP PowerShell in SharePoint Online Office 365.

$userName = "preeti@tenant.onmicrosoft.com"
$passWord = "**********"
$encPassWord = convertto-securestring -String $passWord -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $userName, $encPassWord
Connect-PnPOnline -Url "https://tenant-admin.sharepoint.com/" -Credentials $cred

Get-PnPSiteCollectionAdmin
Write-Host "Retrieved Site Collection Administrator."
Get Site Collection Administrator SharePoint Online Using PnP PowerShell
Get Site Collection Administrator SharePoint Online Using PnP PowerShell

This is how to get sharepoint site collection administrator using PnP PowerShell.

16. Remove Site Collection Administrator SharePoint Online using PnP PowerShell

Now, we will see how to remove SharePoint site collection administrator usng PnP PowerShell in SharePoint Online Office 365.

$userName = "preeti@tenant.onmicrosoft.com"
$passWord = "**********"
$encPassWord = convertto-securestring -String $passWord -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $userName, $encPassWord
Connect-PnPOnline -Url "https://tenant-admin.sharepoint.com/" -Credentials $cred

Remove-PnPSiteCollectionAdmin -Owners @("preeti@tenant.onmicrosoft.com", "bijay@tenant.onmicrosoft.com")
Write-Host "Removed site collection owners from the site collection in the current context."
Remove Site Collection Administrator SharePoint Online Using PnP PowerShell

This below PnP PowerShell command will help you to remove all existing site collection administrators from the SharePoint site collection.

Get-PnPSiteCollectionAdmin | Remove-PnPSiteCollectionAdmin

17. Get all Site Collections in SharePoint Online Using PnP PowerShell

Now, we will see how to get site collections in SharePoint Online using pnp PowerShell.

$userName = "preeti@tenant.onmicrosoft.com"
$passWord = "**********"
$encPassWord = convertto-securestring -String $passWord -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $userName, $encPassWord
Connect-PnPOnline -Url "https://tenant-admin.sharepoint.com/" -Credentials $cred

Get-PnPTenantSite
Write-Host "Retrieved all Site Collections."
Get all Site Collections in SharePoint Online Using PnP PowerShell
Get all Site Collections in SharePoint Online Using PnP PowerShell

This is how to get SharePoint site collections using PnP PowerShell.

18. Get all Sub Sites in SharePoint Online Using PnP PowerShell

If you want to get all the sub sites from a SharePoint Online site collection using PnP PowerShell.

Below is the PnP PowerShell script to get all sub sites in SharePoint Online site collection.

$userName = "preeti@tenant.onmicrosoft.com"
$passWord = "**********"
$encPassWord = convertto-securestring -String $passWord -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $userName, $encPassWord
$siteURL= "https://tenant.sharepoint.com/sites/SharePointSky/"
Connect-PnPOnline -Url $siteURL -Credentials $cred

Get-PnPSubWebs
Write-Host "All the Sub Sites are retrieved from SharePoint Online."
Get all Sub Sites in SharePoint Online Using PnP PowerShell
Get all Sub Sites in SharePoint Online Using PnP PowerShell

This is how to get all Sub Sites in SharePoint Online using PnP PowerShell.

19. Restore SharePoint Online Site Using PnP PowerShell

Below is the PnP PowerShell script to restore a SharePoint Online site using PnP PowerShell.

$userName = "preeti@tenant.onmicrosoft.com"
$passWord = "**********"
$encPassWord = convertto-securestring -String $passWord -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $userName, $encPassWord
$DeletedSiteURL= "https://tenant.sharepoint.com/sites/TSInfoModernTeam"
Connect-PnPOnline -Url "https://tenant-admin.sharepoint.com/" -Credentials $cred

Restore-PnPTenantRecycleBinItem -Url $DeletedSiteURL -Force -ErrorAction Stop
Write-Host "The SharePoint Deleted Site has been restored successfully."
Restore SharePoint Online Site Using PnP PowerShell
Restore SharePoint Online Site Using PnP PowerShell
Restore SharePoint Online Sites Using PnP PowerShell
Restore SharePoint Online Site Using PnP PowerShell

This is how to restore a SharePoint site using pnp powershell.

20. Create a SharePoint Online List using PnP PowerShell

Now, we will see how to create a SharePoint Online List using PnP PowerShell. Below represents the PowerShell command:

$cred= Add-PnPStoredCredential -Name https://tenant.sharepoint.com -Username preeti@tenant.onmicrosoft.com -Password (ConvertTo-SecureString -String "**********" -AsPlainText -Force)
$siteurl="https://tenant.sharepoint.com/sites/TSInfoClassic"
Connect-PnPOnline -Url $siteurl -Credentials $cred
$listName="TSInfoTeam"

New-PnPList -Title $listName -Url "TSInfoTeam" -Template GenericList
Write-Host ("SharePoint List is created")
pnp powershell create list
Create a SharePoint Online List using PnP PowerShell

When you run the above PnP PowerShell command, then you can see the SharePoint Online list will create which is available in the Site Content of the SharePoint Online Site.

Create a SharePoint Online List using PnP PowerShell
pnp powershell create list

This is how to create a list using PnP PowerShell.

21. Check if SharePoint Online List exists or not using PnP PowerShell

If you want to check if the SharePoint Online List exists in your SharePoint Site or not, then follow the below PnP PowerShell command:

$cred= Add-PnPStoredCredential -Name https://tenant.sharepoint.com -Username preeti@tenant.onmicrosoft.com -Password (ConvertTo-SecureString -String "**********" -AsPlainText -Force)
$siteurl="https://tenant.sharepoint.com/sites/TSInfoClassic"
Connect-PnPOnline -Url $siteurl -Credentials $cred
$listName="TSInfoTeam"
if($listName)  
        {  
           write-Host  ("SharePoint List is already exists")   
        }  
        else 
        {
            Connect-PnPOnline -Url $siteurl -Credentials $cred            
            New-PnPList -Title $listName -Url "TSInfoTeam" -Template GenericList
            Write-Host ("SharePoint List is created")
        }

Once you will run the command, then it will let you know if the SharePoint exists or not.

Check if SharePoint Online List exists or not using PnP PowerShell

22. Remove SharePoint Online List using PnP PowerShell

We can easily remove a SharePoint Online list from SharePoint site collection using the PnP PowerShell command.

$cred= Add-PnPStoredCredential -Name https://tenant.sharepoint.com -Username preeti@tenant.onmicrosoft.com -Password (ConvertTo-SecureString -String "**********" -AsPlainText -Force)
$siteurl="https://tenant.sharepoint.com/sites/TSInfoClassic"
Connect-PnPOnline -Url $siteurl -Credentials $cred
$listName="TSInfoTeam"

Remove-PnPList -Identity $listName
Write-Host ("SharePoint List is Removed")

Once you will run the above command, then it will ask you to ensure to delete the SharePoint list as shown below.

Remove SharePoint Online List using PnP PowerShell
Remove SharePoint Online List using PnP PowerShell

When you will click on Yes, then the SharePoint Online List will remove.

Remove a SharePoint Online List using PnP PowerShell
Remove SharePoint Online List using PnP PowerShell

This is how to delete a SharePoint list using PnP PowerShell.

23. Remove SharePoint Online List with Force

Similarly, if you will run the below PnP PowerShell command, then the SharePoint list will remove forcefully without asking the confirmation.

Remove-PnPList -Identity $listName -Force
Remove SharePoint Online Lists using PnP PowerShell

24. Remove SharePoint Online List with Recycle bin

When you will run the below PnP PowerShell command, then it will ask you to ensure to delete the SharePoint Online List.

Remove-PnPList -Identity $listName -Recycle
Remove SharePoint List using PnP PowerShell
Remove SharePoint Online List with Recycle bin

Once you clicked on Yes button, then the SharePoint Online List will remove and it will move to the Recycle bin as like the below screenshot.

Remove SharePoint Lists using PnP PowerShell
Remove SharePoint Online List with Recycle bin

25. Retrieve a SharePoint Online List using PnP PowerShell

Below is the PnP PowerShell command to retrieve the SharePoint Online List from your SharePoint Online Site.

$cred= Add-PnPStoredCredential -Name https://tenant.sharepoint.com -Username preeti@tenant.onmicrosoft.com -Password (ConvertTo-SecureString -String "**********" -AsPlainText -Force)
$siteurl="https://tenant.sharepoint.com/sites/TSInfoClassic"
Connect-PnPOnline -Url $siteurl -Credentials $cred

Get-PnPList -Identity 486ee331-e38f-4d89-82cf-8e0bef45d853
Write-Host ('SharePoint List is Retrieved with Id')
Get-PnPList -Identity Lists/TSInfoTeam
Write-Host ('SharePoint List is Retrieved with URL')

When you will run the command, then you will get your SharePoint Online List with List Title, Id and Url as shown below.

Retrieve SharePoint Online List using PnP PowerShell
Retrieve a SharePoint Online List using PnP PowerShell

This is how to get SharePoint Online list using PnP PowerShell.

26. Update SharePoint Online List Title Using PnP PowerShell

Suppose you want to update your SharePoint Online List Title with a new title name, then you can do it by using PnP PowerShell command.

Here in the below screenshot, my SharePoint List Title is TSInfoTeam. I want to update this List Title as TSInfoGroup.

Update SharePoint List Title Using PnP PowerShell
Update SharePoint List Title Using PnP PowerShell

Follow this below PnP PowerShell command to update the SharePoint Online List Title.

$cred= Add-PnPStoredCredential -Name https://tenant.sharepoint.com -Username preeti@tenant.onmicrosoft.com -Password (ConvertTo-SecureString -String "**********" -AsPlainText -Force)
$siteurl="https://tenant.sharepoint.com/sites/TSInfoClassic"
Connect-PnPOnline -Url $siteurl -Credentials $cred
$listName="TSInfoTeam"

Set-PnPList -Identity $listName -Title 'TSInfoGroup' -Description 'This SharePoint List is used for TSInfo'
Write-Host ('SharePoint List title is updated')
Update SharePoint Online List Title Using PnP PowerShell
Update SharePoint List Title Using PnP PowerShell

Once the above command will run and finish, go to that SharePoint Online List and just refresh that page. Then you can see the title has been updated as shown in the below screenshot.

Update SharePoint Online Lists Title Using PnP PowerShell
Update SharePoint List Title Using PnP PowerShell

As I have also updated the SharePoint Online List Description, you can see the updated description in the List Settings page as like below.

PnP PowerShell Update SharePoint Online Lists Title
PnP PowerShell Commands for SharePoint Online List

This is how to update SharePoint list title using PnP PowerShell.

You may like the following PowerShell tutorials:

I hope you liked the sharepoint pnp powershell examples. We covered the below examples.

  1. How to create a modern team site using PnP PowerShell (with Office 365 group)
  2. How to create a modern team site without an office 365 group using PnP PowerShell
  3. PnP PowerShell get all modern team sites
  4. How to remove a Modern SharePoint Team Site using PnP PowerShell
  5. How to remove modern SharePoint Team Site (with Site URL) with Force
  6. Remove Modern SharePoint Team Site (with Site URL) from the Recycle Bin
  7. Create a SharePoint Online Communication Site using PnP PowerShell
  8. Get all Communication Site using PnP PowerShell
  9. Delete a Communication Site Using PnP PowerShell
  10. How to delete a SharePoint Communication Site (with Site URL) with Force
  11. Delete the SharePoint Communication Site (with Site URL) from the Recycle Bin
  12. Get SharePoint site created date using PnP PowerShell
  13. PnP PowerShell add a user to sharepoint group
  14. PnP PowerShell add a user as site collection administrator
  15. Get SharePoint Site Collection Administrator using PnP PowerShell
  16. Remove Site Collection Administrator SharePoint Online using PnP PowerShell
  17. How to Get all Site Collections in SharePoint Online Using PnP PowerShell
  18. Get all Sub Sites in SharePoint Online Using PnP PowerShell
  19. How to restore SharePoint Online Site Using PnP PowerShell
  20. Create a SharePoint Online List using PnP PowerShell
  21. Check if SharePoint Online List exists or not using PnP PowerShell
  22. How to Remove SharePoint Online List using PnP PowerShell
  23. Remove SharePoint Online List with Force
  24. Remove SharePoint Online List with Recycle bin
  25. Retrieve a SharePoint Online List using PnP PowerShell
  26. How to update SharePoint Online List Title Using PnP PowerShell
>