recover deleted files

Glenn Maxwell 10,146 Reputation points
2020-08-01T05:42:22.257+00:00

Hi experts

i have a share point site which has folders and sub folders.
Some of the files and folders are deleted and i can see them in recycle bin, i dont want to restore all of them, is it possible to export the items of recycle bin from shell to csv file and then edit the csv file with the files and folders i require and import this csv file to restore.

  1. is it possible to restore it to some other folder rather than overwrite.
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,606 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,798 questions
{count} votes

Accepted answer
  1. ChelseaWu-MSFT 6,316 Reputation points
    2020-08-03T06:57:56.12+00:00

    Are you using SharePoint Online or SharePoint Server?

    Please see the answers below for SharePoint Online:

    1 You can export the items from Recycle Bin using PowerShell. Please see the sample script below:

    #Get the PnP PowerShell module
    ##Skip this line if you already have it
    Install-Module SharePointPnPPowerShellOnline
    
    #Config Variables
    $SiteURL = "<siteURL>"
    
    #Connect to PnP Online
    Connect-PnPOnline -Url $SiteURL -Credentials (Get-Credential)
    
    #Get Recycle bin Items
    Get-PnPRecycleBinItem | Select Title, ItemType, Size, ItemState, DirName, DeletedByName, DeletedDate | Format-table -AutoSize
    
    #Export results to CSV
    ##This is the path where you want to export this file
    Get-PnPRecycleBinItem | Export-Csv C:\restore.csv 
    

    Reference: SharePoint Online: Search Recycle Bin using PowerShell.

    2 PnP PowerShell does not support restoring items from csv file. See a reference here: Restore Recycle bin SharePoint Online with PowerShell.
    If you are familiar with CSOM (Client -Side Object Model), here is a sample script you can take a look at: Restore SharePoint Item From Recycle Bin Using PowerShell.

    3 It is not possible to restore the documents to different locations for the time being.

    0 comments No comments

0 additional answers

Sort by: Most helpful