How to download folders from sharepoint server 2019 site?

Tevon2.0 1,106 Reputation points
2023-07-17T20:21:30.1433333+00:00

Using SharePoint 2019 and I've got a list with over 4k files and folders. How can I allow standard site users to be able to copy/move folders from one section into another? Example I want to take a folder from List Alpha and move it into list beta. The goal is to accomplish this without using power shell or one drive if possible. If power shell must be used please provide a script that could accomplish the request if possible. Thank you in advance!

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,418 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,267 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,629 questions
SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
2,991 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Xyza Xue_MSFT 28,051 Reputation points Microsoft Vendor
    2023-07-18T02:25:48.1533333+00:00

    Hi @Tevon2.0 ,

    Unfortunately, there is no direct way to move a folder from List Alpha to List beta in SharePoint 2019.

    The most convenient way is to use Powershell to achieve.

    Here are steps and code ( For example, you need to move the folder named "folder1" from list alpha to list beta. ):

    Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
    $url = "http://sp19:3571/sites/xyzatest/"
    $web = Get-SPWeb $url
    $list = $web.Lists["Alpha"]
    
    foreach($folder in $list.Folders)
    {
      if($folder.Name -eq "folder1")
      {
        $query = New-Object -Type 'Microsoft.SharePoint.SPQuery'
        $query.Folder = $folder.Folder
        $folderItems = $list.GetItems($query)
    
        foreach($item in $folderItems)
        {
          $file = $web.GetFile($item.Url)
          $targetPath = "beta/folder1/" + $file.Name
          $file.MoveTo($targetPath)
        }
      }
    }
    

    1.Create an empty folder named "folder1" in list beta.

    2.Replace the siteurl:

    $url = "http://sp19:3571/sites/xyzatest/"

    3.Use SharePoint 2019 management Shell to run the code.

    User's image

    The result of the operation is as follows:

    User's image


    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 Answers by the question author, which helps users to know the answer solved the author's problem.