There are many articles that will tell you to use SharePoint Designer, Save the library as template and recreate it or something else. But you are lazy SharePoint administrator, for you here is a way to do this in PowerShell.
$web = Get-SPWeb http://portal-2k8r2.ilabs.l/ ## the Url of the Web $list = $web.Lists["Nice New Library"] ##Get by current Library Name $list.RootFolder.MoveTo("/Nice New Library") ## Change the Url(relative to the Web)
And here is the result. Be careful because the Name of the library may be changed as well if it is not the same as the new url.
In this case we are renaming the Root Folder of the library the original URL of the library in this example is http(s)://<WebUrl>/<LibraryRootFolder>.
However if you are renaming List it is likely that the URL of your list is http(s)://<WebUrl>/Lists/<LibraryRootFolder> in this case if you do not want to put the list in the Root folder and keep the .../Lists/... The code will be as follows:
$web = Get-SPWeb http://portal-2k8r2.ilabs.l/ ## the Url of the Web $list = $web.Lists["Nice New List"] ##Get by current List Name $list.RootFolder.MoveTo("/List/Nice New List") ## Change the Url
You can see current RootFolder with something like this:
$web = Get-SPWeb http://portal-2k8r2.ilabs.l/ ## the Url of the Web $list = $web.Lists["Nice New List"] ##Get by current List Name $list.RootFolder
See the value of property ServerRelativeUrl.
[*UPDATE*]: Check out a Video Tutorial of this solution HERE
No comments:
Post a Comment