Cannot Rename Sharepoint Document Library Address

Technician123 106 Reputation points
2022-05-11T20:20:12.847+00:00

For some reason I cannot rename sharepoint document library address, but can rename display name:
201195-image.png

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,558 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jinwei Li-MSFT 4,721 Reputation points Microsoft Vendor
    2022-05-12T07:33:20.87+00:00

    Hi @Technician123 ,

    You could use following PowerShell command to change library url.

    PowerShell:

    Connect-SPOService -Url https://contoso-admin.sharepoint.com  
    #Config Parameters  
    $SiteURL= "https://contoso.sharepoint.com/sites/name"  
    $ListName="doc111"  
    $NewListURL="doc222"  
      
    #Setup Credentials to connect  
    $Cred = Get-Credential  
    $Cred = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.UserName,$Cred.Password)  
      
    Try {  
    #Setup the context  
    $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)  
    $Ctx.Credentials = $Cred  
      
    #Get the List  
    $List=$Ctx.web.Lists.GetByTitle($ListName)  
    $Ctx.Load($List)  
      
    #sharepoint online change library url powershell  
    $List.Rootfolder.MoveTo($NewListURL)  
    $Ctx.ExecuteQuery()  
      
    Write-host -f Green "List URL has been changed!"  
    }  
    Catch {  
    write-host -f Red "Error changing List URL!" $_.Exception.Message  
    }  
    

    201247-image.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.