SharePoint Online: Rename a List or Document Library using PowerShell

Requirement: SharePoint Online PowerShell to Rename a List or document library.

How to Rename List in SharePoint Online?

When you create a list in Microsoft SharePoint Online, the name is automatically generated based on the list’s title. In some cases, you may want to rename the list at a later time. This article will show you how to rename a SharePoint Online list using the Classic and Modern user interfaces. We will also show you how to rename a list in SharePoint Online using PowerShell.

To change the list name in SharePoint Online, follow these steps:

  1. Navigate to your SharePoint Online list or library you want to rename. Click on the Settings Icon and then “List Settings” (In Classic UI, Under the “List” tab, Click on the “List Settings” button from the ribbon)
  2. On the List settings page, click on the “List name, description and navigation” link under the “General Settings” heading.
  3. On the General Settings page, You can update the list’s title and click on the Save button to commit your changes.
    sharepoint online powershell rename list

This changes the Title of the list or document library. Similarly, to rename a document library in SharePoint, do the following:

  1. Browse to your SharePoint Document library.
  2. Click on the Settings gear and then choose “Library Settings”.
    rename a document library in sharepoint
  3. This lets you edit the list or document library name. Enter the new library name and click on Save.

Rename a list in SharePoint Online using SharePoint Designer

To rename a list using SharePoint Designer, follow these steps:

  1. Open SharePoint Designer and connect to the site containing the list you want to rename.
  2. In the left navigation pane, click on “Lists and Libraries.”
  3. Find and click on the list you want to rename from the list of available lists and libraries.
  4. In the list settings page, locate the “Name” field. This is where you can edit the name of the list.
  5. Enter the new name for your list in the “Name” field and hit enter.
    rename a list in sharepoint using sharepoint designer
  6. Save your changes by clicking the “Save” button at the top left of the screen.

This process will rename your list in SharePoint.

PowerShell to Rename a List in SharePoint Online

Now let’s walk you through the process of renaming a SharePoint Online list using PowerShell. This can be helpful if you have a long or difficult-to-remember list name or want to rename a list as part of an automation process. Here is the PowerShell script to change the name of a SharePoint Online List:

#Load SharePoint CSOM Assemblies
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"

#Function to Rename a SharePoint Online List or library using PowerShell
Function Rename-SPOList
{
    param
    (
        [string]$SiteURL  = $(throw "Please Enter the Site URL!"),
        [string]$ListName = $(throw "Please Enter the List Name to Rename!"),
        [string]$NewName = $(throw "Please Enter the New Name for the List!")
    )
    Try {
        #Get Credentials to connect
        $Cred= Get-Credential
        $Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.Username, $Cred.Password)
 
        #Setup the context
        $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
        $Ctx.Credentials = $Credentials

        #Get the List
        $List=$Ctx.Web.Lists.GetByTitle($ListName) 

        $List.Title = $NewName
        $List.Update()
        $Ctx.ExecuteQuery()
            
        Write-Host "List has been Renamed to '$NewName' Successfully!" -ForegroundColor Green  
    }
    Catch {
        write-host -f Red "Error Renaming List!" $_.Exception.Message
    }
}
 
#Call the function to rename a list or library
Rename-SPOList -SiteURL "https://Crescent.sharepoint.com/" -ListName "Documents" -NewName "Team Documents"

This script quickly and easily renames your list without touching the user interface.

You can also rename a document library in SharePoint Online with this PowerShell script!

SharePoint Online: Change List Name using PnP PowerShell

If you need to rename a list in SharePoint Online with just a few lines of code, PnP PowerShell is the way to go! Here is how to change the name of a document library in SharePoint Online with the PnP PowerShell cmdlet Set-PnPList:

#Config Variables
$SiteURL = "https://Crescent.sharepoint.com"

#Connect to PnP Online
Connect-PnPOnline -Url $SiteURL -Interactive

#Rename "Projects" List to "Projects Archive"
Set-PnPList -Identity "Projects" -Title "Projects Archive"

This changes the name of the “Projects” list to “Projects Archive”.

Conclusion

In summary, renaming a SharePoint list is a straightforward process that can be accomplished through the SharePoint user interface or by using PowerShell. When renaming a list, it’s essential to communicate the change to your users and update any relevant documentation or training materials. This will help minimize confusion and ensure a smooth transition for everyone involved.

Remember, changing the list title doesn’t change the SharePoint list URL! If you need to change a SharePoint Online list URL, refer to How to Change the List URL in SharePoint Online using PowerShell?

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

5 thoughts on “SharePoint Online: Rename a List or Document Library using PowerShell

  • Is there a way renaming multiple lists using a csv file

    Reply
    • Did you ever get a reply?

      Reply
    • Sure! You can read from a CSV and perform rename in Bulk. E.g.,

      #Connect to SharePoint Online
      Connect-PnPOnline -Url "https://YourDomain.SharePoint.com/sites/YourSite" -Interactive
      
      #Assuming your CSV has the "ListName" and "NewName" columns:
      $CSVData = $CSVData = Import-Csv "C:\Temp\ListRename.csv"
      
      #Loop through Each Row in the csv
      ForEach($Row in $CSVData)
      {
          #Rename the List
          Set-PnPList -Identity $Row.ListName -Title $Row.NewName
      }
      
      Reply
  • I have renamed SharePoint List Name by going to List Settings and from there Name and Description and renamed the list. However, some users see the old SharePoint List Name. This also happened with the Top menu bar which I solved the problem after deleting and creating the same menu bar item again. The list has plenty of items recorded so I can not just delete and create the same list again. Do you know what could cause the problem ?

    Reply
    • Top Navigation cache can be cleared from: Site Settings >> Site information >> View All Site settings >> Navigation >> Click on “Refresh” button in the Structural Navigation : Refresh Cache.

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *