POWERSHELL / SHAREPOINT
FreeIntermediateRead-onlylow

Export modern SharePoint pages inventory

Exports an efficient inventory of modern SharePoint Site Pages using the documented all-pages mode without refetching every page for full contents.

Generated locally in your browser · Runs in your PowerShell environment · Review before running

What this PowerShell script does

Exports an efficient inventory of modern SharePoint Site Pages using the documented all-pages mode without refetching every page for full contents.

Requirements

  • Scope - Choose one SharePoint site or a CSV containing a SiteUrl column. (Required)
  • SharePoint site URL - Required for single-site scope. (Conditional)
  • Site list CSV path - CSV must contain a SiteUrl column. Duplicate URLs are ignored. (Conditional)
  • Entra app client ID - Your PnP app client ID. Leave empty only when a PnP default client ID is already configured. (Optional)
  • CSV output path - Use a new absolute Windows CSV path. (Required)

Environment

  • Module: PnP.PowerShell
  • Runtime: 7.4+
  • Authentication: Interactive PnP login with your own Entra app/client ID or configured default
  • Permissions: AllSites.Read · SharePoint Administrator
  • Risk: Low
Review before you run The generated script is read-only, but authentication and access requirements still apply in your tenant.
OPS / WORKSPACE

Ready to generate

Configure Export modern SharePoint pages inventory in the Builder, review the generated PowerShell and run it in your own environment.

When to use this template

Retrieves all modern pages once per selected site. The official PnP documentation states this mode returns fewer details and requires SharePoint Online Administrator permissions; Opselith does not add a slower per-page refetch by default.

Important limitations

PowerShell and PnP requirements

Current PnP.PowerShell releases require PowerShell 7.4 or later. Interactive authentication requires your own Entra application/client ID, or a default client ID that you have configured for PnP.PowerShell. Opselith does not connect to SharePoint or run the script on your behalf.

Generate the script

  1. Open the template in the PowerShell Builder.
  2. Enter the requested URLs, client ID (when needed) and a new CSV output path.
  3. Generate the script, review its permissions and commands, then run it in your own PowerShell environment.
Generate Export modern SharePoint pages inventory →
OPS / SCRIPT DETAILS

Script details

Exports an efficient inventory of modern SharePoint Site Pages using the documented all-pages mode without refetching every page for full contents. Review these details before generating or running the script.

sharepointmodern-pagessite-pagesinventorymigrationexport

What it works with

Module: PnP.PowerShell

Context: PowerShell 7.4+ · SharePoint Online · PnP.PowerShell

Compatibility: PowerShell 7.4+ is required by current PnP.PowerShell releases.

Permissions and impact

Permissions: AllSites.Read · SharePoint Administrator

Risk: Low

Execution impact: Read-only. The script reads the all-pages Site Pages inventory for each selected site and does not publish, edit or download page content.

Parameters

  • Scope - Choose one SharePoint site or a CSV containing a SiteUrl column. (Required)
  • SharePoint site URL - Required for single-site scope. (Conditional)
  • Site list CSV path - CSV must contain a SiteUrl column. Duplicate URLs are ignored. (Conditional)
  • Entra app client ID - Your PnP app client ID. Leave empty only when a PnP default client ID is already configured. (Optional)
  • CSV output path - Use a new absolute Windows CSV path. (Required)

Output

Output: CSV report with SiteUrl, PageName, Title, PageType, LayoutType, PromotedState, Created, Modified, Author, Editor, Status and Error where those properties are returned by the all-pages response.

This template is available in the free library and is generated locally in your browser.

Example use

Exports an efficient inventory of modern SharePoint Site Pages using the documented all-pages mode without refetching every page for full contents.

Enter the required values in the Builder, review the generated script and confirm the output before running it.

Before you run: Use PowerShell 7.4+ with PnP.PowerShell and a SharePoint Administrator account. Select one site or a SiteUrl CSV and choose a new CSV output path. The all-pages command deliberately uses the documented lower-detail mode to avoid an N+1 full-page crawl.

Opselith quality checks

  • Included in the current Opselith PowerShell quality suite
  • Current Get-PnPPage all-pages limitation and administrator requirement documented
  • No per-page detail refetch loop
  • Per-site failures are isolated and reported
  • Only returned page metadata is exported; missing properties are left blank