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?
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?
Try following these steps for SharePoint Online Modern experience document library:
Go to your SharePoint Online Modern experience document library view
Click on Export to Excel option from top command bar:
It will download a .iqy
file, open it in Excel app on your desktop
Use "Save as" option and save it as a new CSV file.
Documentation: Export to Excel from SharePoint or Microsoft Lists
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!"