1

I have created a SharePoint to store about 800 files.

My problem is that I would like to generate a file list (txt or csv) which contains the file name and the link pointing to each file.

Is there a way to automatically do it?

4
  • Try using Export to Excel feature in SharePoint. After exporting the content in file, open it in "Excel" app and save it as a "CSV" file. Let me know if it works for you. Commented Nov 20, 2023 at 2:23
  • 1
    HEllo Ganesh,I did not realize this feature was already there. Thanks so much have a nice day
    – Manu G.
    Commented Nov 22, 2023 at 6:54
  • Great, glad it worked for you Manu! Commented Nov 22, 2023 at 7:35
  • I have added this solution as an answer below. Please accept it as an Answer as it helped you & it will help others with similar question in future to find the correct answer easily. Commented Nov 22, 2023 at 7:36

2 Answers 2

0

Try following these steps for SharePoint Online Modern experience document library:

  1. Go to your SharePoint Online Modern experience document library view

  2. Click on Export to Excel option from top command bar:

    enter image description here

  3. It will download a .iqy file, open it in Excel app on your desktop

  4. Use "Save as" option and save it as a new CSV file.

Documentation: Export to Excel from SharePoint or Microsoft Lists

0

You also could use PowerShell to get all file properties.

#Parameters
$SiteURL = "https://wendytest123.sharepoint.com/sites/emilytestnew"
$ListName= "Documents"
$ReportOutput = "C:\DocInventory.csv"
$Pagesize = 5000
   
#Connect to SharePoint Online site
Connect-PnPOnline $SiteURL -Interactive
 
#Delete the Output report file if exists
If (Test-Path $ReportOutput) { Remove-Item $ReportOutput}
 
#Array to store results
$Results = @()
   
#Get all Documents from the document library
$List  = Get-PnPList -Identity $ListName
$global:counter = 0;
$ListItems = Get-PnPListItem -List $ListName -PageSize $Pagesize -Fields Author, Editor, Created, File_x0020_Type -ScriptBlock `
        { Param($items) $global:counter += $items.Count; Write-Progress -PercentComplete ($global:Counter / ($List.ItemCount) * 100) -Activity `
             "Getting Documents from Library '$($List.Title)'" -Status "Getting Documents data $global:Counter of $($List.ItemCount)";} | Where {$_.FileSystemObjectType -eq "File"}
  
$ItemCounter = 0
#Iterate through each item
Foreach ($Item in $ListItems)
{
        $Results += New-Object PSObject -Property ([ordered]@{
            Name              = $Item["FileLeafRef"]
            RelativeURL       = $Item["FileRef"]
            FileType          = $Item["File_x0020_Type"]
            RelativeURL       = $Item["FileRef"]
            CreatedByEmail    = $Item["Author"].Email
            CreatedOn         = $Item["Created"]
            Modified          = $Item["Modified"]
            ModifiedByEmail   = $Item["Editor"].Email
        })
    $ItemCounter++
    Write-Progress -PercentComplete ($ItemCounter / ($List.ItemCount) * 100) -Activity "Exporting data from Documents $ItemCounter of $($List.ItemCount)" -Status "Exporting Data from Document '$($Item['FileLeafRef'])"        
}
  
#Export the results to CSV
$Results | Export-Csv -Path $ReportOutput -NoTypeInformation
   
Write-host "Document Library Inventory Exported to CSV Successfully!"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.