Cannot Rename Sharepoint Document Library Address

Technician123 111 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

Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jinwei Li-MSFT 4,741 Reputation points Microsoft External Staff
    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.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.