POWERSHELL / SHAREPOINT
FreeIntermediateRead-onlyLow

Export SharePoint document library versioning settings

Exports document-library versioning, minor-version, checkout, moderation and draft visibility settings without crawling library content.

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

What this PowerShell script does

Exports document-library versioning, minor-version, checkout, moderation and draft visibility settings without crawling library content.

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)
  • Include hidden lists/libraries - Include hidden document libraries. Leave disabled for the normal admin inventory. (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
  • Risk: Low
Review before you runThe generated script is read-only, but authentication and access requirements still apply in your tenant.
OPS / WORKSPACE

Ready to generate

Configure Export SharePoint document library versioning settings in the Builder, review the generated PowerShell and run it in your own environment.

When to use this template

Use this report when you need a quick governance or migration inventory of library versioning configuration. It reads list-level settings only, so it stays useful on large libraries without enumerating files or individual versions.

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 configured for PnP.PowerShell. Opselith does not connect to SharePoint or execute the script on your behalf.

Generate the script

  1. Open this template in the PowerShell Builder.
  2. Enter the required scope, authentication and output values.
  3. Generate the script, review its permissions and commands, then run it in your own PowerShell environment.
Generate Export SharePoint document library versioning settings →
OPS / SCRIPT DETAILS

Script details

Exports document-library versioning, minor-version, checkout, moderation and draft visibility settings without crawling library content. Review these details before generating or running the script.

sharepointdocument-libraryversioninggovernancemigrationexport

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

Risk: Low

Execution impact: Read-only. Reads document-library versioning, checkout and moderation configuration from list metadata without enumerating files or versions.

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)
  • Include hidden lists/libraries - Include hidden document libraries. Leave disabled for the normal admin inventory. (Optional)
  • CSV output path - Use a new absolute Windows CSV path. (Required)

Output

Output: CSV report with SiteUrl, LibraryTitle, LibraryUrl, Id, ItemCount, Hidden, EnableVersioning, EnableMinorVersions, MajorVersionLimit, MajorWithMinorVersionsLimit, ForceCheckout, EnableModeration, DraftVersionVisibility, Status and Error.

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

Example use

Exports document-library versioning, minor-version, checkout, moderation and draft visibility settings without crawling library content.

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 interactive authentication. Select one site or a SiteUrl CSV, decide whether hidden libraries should be included, and choose a new CSV output path.

Opselith quality checks

  • Included in the current Opselith PowerShell quality suite
  • No file or version enumeration
  • Standard list properties are used for versioning configuration
  • Effective tenant/site automatic version-expiration policy is not guessed
  • Per-site failures are isolated and reported