Collaborate, Innovate, Automate

PnP PowerShell Scripts

← Back to Resources

PnP PowerShell Scripts

Ready-to-use PowerShell scripts for SharePoint Online and Microsoft 365 administration:

All Site Navigation Content Metadata Folder Content Approval Multilingual Security Search Migration File System Storage
Script Name Description Tags
Create Site Columns Automate site column creation across SharePoint sites Site Content
Create Navigation Build consistent navigation structures programmatically Navigation Site
Create Content Types Standardise content types with metadata definitions Content Metadata
Create Term Store Implement enterprise taxonomy and managed metadata Metadata
Create Multilingual Term Store Provision term groups, term sets, and terms with per-locale translated labels from a JSON configuration file Metadata Multilingual
Add Navigation Translations Support multilingual navigation experiences Navigation Multilingual
Create Bilingual Navigation Build a complete EN/FR Quick Launch navigation from scratch using a JSON configuration file, creating and translating all nodes in a single operation Navigation Multilingual
Update Folder Approval Status Manage content approval workflows for individual folders Folder Content Approval
Update Folder Approval Statuses Bulk update approval statuses across multiple SharePoint folders Folder Content Approval
Update Content Type Name Rename content types while preserving configurations and data Content Metadata
Update Pages Approval Status in a Folder Manage page approval workflows for all pages within a specific folder Folder Content Approval
Update Pages Content Type in a Folder Bulk update content types for all pages within a specific folder structure Folder Content
Create Group & Add Users Automate SharePoint group creation and bulk user assignment for permission management Site Security
Create Translations of Pages in Folder Create translated page structure for all pages in a folder with duplicate checking Multilingual Content
Add Group Members Automate user provisioning with appropriate permission levels for SharePoint sites Site Security
Add Multiple Site Collection Admins Bulk assign site collection administrators across multiple SharePoint Online sites using a CSV file Site Security
Add Multiple Document Libraries Bulk create multiple SharePoint Online document libraries from a CSV file in a single operation Content Site
Create Folder Structure Automate the creation of standardized folder hierarchies in SharePoint document libraries Folder Site
Export Multiple Pages Bulk export SharePoint pages for backup, migration, or content management Content Site
Import Multiple Pages Bulk import SharePoint pages for site restoration or content migration Content Site
Site Template Export Export SharePoint sites as reusable templates for standardisation and provisioning Site
Site Template Apply Apply exported site templates to provision new SharePoint sites with consistent configurations Site
Create Group & Add Group Members Automate SharePoint group creation and add multiple users as members in a single operation Site Security
Compare Two Site Settings Compare configuration settings between two SharePoint sites to identify differences and ensure consistency Site
Get Site Crawl Logs Retrieve SharePoint site crawl logs for search troubleshooting and optimisation analysis Search Site
Get Site Search Settings Retrieve comprehensive SharePoint site search settings and configuration details Search Site
Move SharePoint Pages Move pages between folders with single and batch operation support for content reorganization Migration Content
Find All Links on Site Pages Scan all SharePoint site pages to identify and report hyperlinks for content audits and migration planning Migration Content
Set 404 Error Page Configure custom 404 error page for SharePoint Online sites to improve user experience Search Navigation
Update URLs in an Excel Column Bulk update URLs in Excel spreadsheets for SharePoint migrations and domain consolidation projects Migration Content
Create SharePoint List Automate creation of custom SharePoint lists with configurable templates and CSV logging Content Metadata
Delete Term Group Safely remove a term group and all its term sets from the SharePoint Online term store Metadata
Export Megamenu Navigation Export the full megamenu navigation hierarchy (parent, child, grandchild) to CSV for auditing and documentation Navigation Site
Site Settings Export Export a comprehensive snapshot of a SharePoint site's configuration to JSON for auditing, comparison, and migration planning Site Migration
Folder Path Length Analyse folder and page path lengths in the Site Pages library to identify items approaching SharePoint's 400-character URL limit Content Metadata Migration
Find Column Usage Identify where named site columns are used across lists, libraries, and content types within a SharePoint site Metadata Search
Find Base List Template ID Return the base template name and numeric template ID of any SharePoint Online list or library Content Site
Create MessageBanner List Provision the MessageBanner SharePoint list with all required columns for the PnP Modern Search intranet banner solution Content Search Site
Find Large Files on File Share Scan a file share or local directory recursively to identify and report files larger than 20MB for storage audits and migration planning File System Migration
Set List Item by ID Bulk update SharePoint Online list item fields by item ID using a CSV file for precise, targeted list management Content Metadata
Get-TenantStorage Export a tenant-wide SharePoint storage report to CSV, flagging sites by high usage and inactivity for governance reviews and quota planning Storage Site
Get Preservation Library Check whether a Preservation Hold Library exists on a SharePoint site and report how many items it contains Storage Site
Get-VersionReport Report version counts for every file in a SharePoint document library — read-only audit, no changes made. Run before Invoke-VersionTrim. Storage Site
Invoke-VersionTrim Permanently delete versions beyond a configured threshold across all files in a SharePoint document library. Run Get-VersionReport first. Storage Site
Add HTML to PnP Modern Search Templates Inject a CTA button and supporting CSS into multiple PnP Modern Search Handlebars result templates stored in a Site Assets folder Search Content
Create TranslationDrift List Create the TranslationDrift SharePoint list with all required columns for tracking translation status across a multilingual site Multilingual Content Metadata
Get-TranslationDrift Scan Site Pages, match English pages to French translations, and populate the TranslationDrift list with In Sync, Stale, or Missing status Multilingual Content Metadata

Microsoft 365 Documentation

PowerShell Resources

Tools & Utilities