MQS™
SharePoint

How to Export Document Metadata from SharePoint

SharePoint has a built-in Export to Excel option for document libraries. For more control, PowerShell and the Microsoft 365 CLI give you full flexibility.

Built-in Export
Yes (Excel)
Admin Helpful
For PowerShell
Best Output
Excel / CSV
Time to First Export
5-20 min
i
The short answer

SharePoint is the most export-friendly platform in this guide series. Any user with read access can click Export to Excel on a document library and get a spreadsheet of all file metadata in that library. For automated, repeatable, or cross-site exports, PnP PowerShell is the standard tool.

1

Export to Excel (Built-in)

EasyBest for: Anyone with access to the document libraryOutput: Excel~5 minutes

This is the fastest path. One click from any document library, and you have a live Excel spreadsheet connected to your SharePoint data. You can then save it as a regular Excel file or CSV.

1
Navigate to the SharePoint document library whose metadata you need. Make sure the columns you need are visible in the current view. If important metadata columns are hidden, click Add column or edit the view to include them first.
2
Click the Export button in the command bar at the top of the library. Select Export to Excel. Your browser will download an .iqy file.
3
Open the .iqy file. Excel will launch and prompt you to enable the data connection. Click Enable. Your file metadata will load as a table.
4
Save as a standalone file: File → Save As and choose Excel Workbook (.xlsx) or CSV (.csv). This breaks the live connection and gives you a static snapshot of your metadata.
Customize your view first
The Export to Excel feature exports exactly what's in the current view. If you need custom metadata columns (choice fields, managed metadata, person fields), add them to the view before exporting. You can create a dedicated "Metadata Export" view that includes all the columns you need.
!
About the .iqy format
Some modern browsers may flag the .iqy file as potentially unsafe since it creates a data connection. This is expected behavior — the file connects to your SharePoint site to pull data. If your organization blocks .iqy downloads, use Method 2 or Method 3 instead.
2

PnP PowerShell

ModerateBest for: IT admins, SharePoint admins, consultantsOutput: CSV~15-30 minutes

PnP PowerShell (Patterns and Practices) is the most widely used community tool for SharePoint automation. It gives you full control over which fields to export, handles large libraries with pagination, and outputs directly to CSV. IT admins can run this across entire site collections in a single script.

1
Install PnP PowerShell if you don't have it: Install-Module PnP.PowerShell -Scope CurrentUser
2
Connect to your SharePoint site: Connect-PnPOnline -Url "https://contoso.sharepoint.com/sites/yoursite" -Interactive
3
Run the export script below. Adjust the -List name and -Fields to match your library and the metadata columns you need.
powershell
# Connect to SharePoint
Connect-PnPOnline -Url "https://contoso.sharepoint.com/sites/yoursite" -Interactive

# Export document library metadata to CSV
$items = Get-PnPListItem -List "Documents" -PageSize 1000 -Fields \
    "FileLeafRef","Title","Created","Modified","Editor","Author", \
    "File_x0020_Size","ContentType","CustomColumn1","TaxonomyField1"

$results = $items | ForEach-Object {
    [PSCustomObject]@{
        FileName     = $_["FileLeafRef"]
        Title        = $_["Title"]
        Created      = $_["Created"]
        Modified     = $_["Modified"]
        ModifiedBy   = $_["Editor"].LookupValue
        CreatedBy    = $_["Author"].LookupValue
        Size         = $_["File_x0020_Size"]
        ContentType  = $_["ContentType"].Name
        CustomField  = $_["CustomColumn1"]
        ManagedMeta  = $_["TaxonomyField1"].Label
        FilePath     = $_["FileRef"]
    }
}

$results | Export-Csv -Path "sharepoint_metadata.csv" -NoTypeInformation
Write-Host "Exported $($results.Count) items to sharepoint_metadata.csv"
Exporting across multiple libraries
To export metadata from every document library in a site, use Get-PnPList -BaseTemplate DocumentLibrary to get all libraries, then loop through each one with the export script above. This is particularly useful for site-wide metadata audits.
3

CLI for Microsoft 365

ModerateBest for: Cross-platform teams (macOS/Linux), DevOpsOutput: CSV~15-20 minutes

The CLI for Microsoft 365 (formerly Office 365 CLI) is a cross-platform Node.js tool that works on macOS, Linux, and Windows. It provides a one-liner for exporting SharePoint list items directly to CSV.

1
Install the CLI: npm install -g @pnp/cli-microsoft365
2
Log in to your Microsoft 365 tenant: m365 login and follow the browser authentication prompt.
3
Run the export command below. The --output csv flag produces CSV directly.
bash
# Log in to Microsoft 365
m365 login

# Export document library metadata as CSV
m365 spo listitem list \
  --webUrl "https://contoso.sharepoint.com/sites/yoursite" \
  --title "Documents" \
  --fields "FileLeafRef,Title,Created,Modified,Editor,Author,File_x0020_Size" \
  --output csv > sharepoint_metadata.csv
i
When to use this over PnP PowerShell
Choose CLI for Microsoft 365 when your team works on macOS or Linux and doesn't have PowerShell installed. It's also a good fit for CI/CD pipelines and automated workflows. For Windows-based SharePoint admin work, PnP PowerShell is generally more full-featured.

What metadata fields can you export?

FieldExport to ExcelPnP PowerShellM365 CLI
File name
File path
File size
Created date
Modified date
Created by
Modified by
Content type
Custom columns (text, choice, number)
Managed metadata (term label)Label onlyLabel only
Managed metadata (full term path)Extra API call
Person/group columns
Lookup columns
Version numberCurrent only
Check-in/out status
Item-level permissionsSeparate call
Version historyPer-item call
!
Known limitations
  • 5,000-item view threshold: SharePoint limits list views to 5,000 items. Export to Excel respects this limit. PnP PowerShell handles it with the -PageSize parameter, which paginates automatically.
  • Managed metadata term paths: All three methods return the term label (e.g., "United States") but not the full hierarchy path (e.g., "Geography > North America > United States"). Getting full paths requires additional calls to the Term Store API.
  • SharePoint On-Premises: Export to Excel and PnP PowerShell work on on-prem. CLI for Microsoft 365 and Microsoft Graph API are SharePoint Online only.

You have your metadata export.
Now score it.

Upload your CSV or Excel file to MQS and get a structural metadata health score out of 100 with dimension breakdowns and actionable diagnostics.

Get Your Free ReportSee How It Works

Exporting from another platform?

Google Drive
How to Export File Metadata from Google Drive
Dropbox
How to Export File Metadata from Dropbox
Box
How to Export File Metadata from Box
Local Server
How to Export File Metadata from a Local Server
Amazon S3
How to Export Object Metadata from AWS S3
Adobe AEM
How to Export Asset Metadata from AEM
Salsify
How to Export Product Metadata from Salsify
Bynder
How to Export Asset Metadata from Bynder
Contentful
How to Export Content Metadata from Contentful
Airtable
How to Export Metadata from Airtable
Canto
How to Export Asset Metadata from Canto
Acquia DAM
How to Export Asset Metadata from Acquia DAM
Orange Logic
How to Export Asset Metadata from Orange Logic
PhotoShelter for Brands
How to Export Asset Metadata from PhotoShelter for Brands
PhotoShelter for Photographers
How to Export Image Metadata from PhotoShelter for Photographers