Vue normale

Il y a de nouveaux articles disponibles, cliquez pour rafraîchir la page.
À partir d’avant-hierFlux principal

Change SharePoint Online List URL using PnP PowerShell

When you create a new list in SharePoint Online site, the list URL is automatically generated based on the name you provide while list creation. SharePoint uses a process called URL encoding to ensure that the URL is valid and does not contain any special characters that could cause problems.

URL encoding replaces special characters in the list name with a percent sign (%) followed by a code that represents the character. For example, if you create a list called My List & Tasks, SharePoint will encode the ampersand (&) as %26 and white space as %20 in the list URL. The resulting list URL will be something like:

https://<site-address>/Lists/My%20List%20%26%20Tasks/AllItems.aspx

There could be several reasons why you might want to change the SharePoint list URL after the list has been created. For example, removing special characters & their encoding (%26 or %20) from URL or changing it with short URL or to enhance the accessibility and usability of the list, by making it easier to remember or share with others. Whatever the reason, changing the SharePoint list URL should be done with caution, and only after careful consideration of the potential impact on the users and the overall system.

You can use below PnP PowerShell script to change SharePoint online list URL and rename the list after list creation:

# SharePoint online site URL
$siteUrl = "https://contoso.sharepoint.com/sites/SPConnect"

# Current display name of SharePoint list
$oldListName = "Images List"

# New list URL
$newListUrl = "Lists/LogoUniverse"

# New display name for SharePoint list
$newListName = "Logo Universe"

# Connect to SharePoint online site
Connect-PnPOnline -Url $siteUrl -Interactive

# Get the SharePoint list
$list = Get-PnPList -Identity $oldListName

# Move SharePoint list to the new URL
$list.Rootfolder.MoveTo($newListUrl)
Invoke-PnPQuery

# Rename List
Set-PnPList -Identity $oldListName -Title $newListName

Once you run above script successfully, you can navigate to SharePoint list using new URL:

Change SharePoint Online List URL using PnP PowerShell
Change SharePoint Online List URL using PnP PowerShell

Note: Changing the SharePoint list URL may have implications for any workflows, alerts, links referring to the list, or customizations that are associated with the list. So, it is recommended to test the changes in a non-production environment before implementing them in a live environment.

Learn more

change-sharepoint-online-list-url-using-pnp-powershell

ganeshsanapblogs

Change SharePoint Online List URL using PnP PowerShell

❌
❌