Skip to main content

How to List All SharePoint Lists with PowerShell Using PnP

When managing SharePoint Online, administrators often need to retrieve a list of all libraries and lists in a site. With the PowerShell PnP module, this process is quick and efficient. In this post, we’ll walk through a simple script that connects to a SharePoint site and retrieves the title and description of all lists.

Prerequisites

To follow along, make sure you have the PnP PowerShell module installed. You can install it using:

Install-Module -Name PnP.PowerShell

Script Overview

Here's the script that connects to your SharePoint Online site and displays the title and description of each list:

# Connect to SharePoint site

Connect-PnPOnline -Url "https://yourtenant.sharepoint.com/sites/yoursite" -Interactive


# Get all lists

$lists = Get-PnPList


# Select and display Title and Description

$lists | Select-Object Title, Description | Format-Table -AutoSize

Use Cases

  • Auditing site contents

  • Documenting SharePoint structure

  • Identifying unused or unnamed lists

Comments

Popular posts from this blog

Key Limitations of Microsoft Power Automate (as of August 2025)

Microsoft Power Automate is a powerful tool for automating business processes, but like any platform, it comes with a set of limitations. Understanding these constraints is essential to designing efficient, scalable, and compliant workflows—especially as your automation strategy grows in complexity.  Here are the most important limits you need to know:  1. Switch Cases Each Switch action supports a maximum of 25 cases. If you need more, consider using nested Switches or alternate logic like parallel branches or conditionals.  2. Actions per Workflow A single flow can contain up to 500 actions. For complex workflows, you may need to split logic into separate flows or use child flows to stay within this limit.  3. Nesting Depth You can nest actions (e.g., conditionals or loops) up to 8 levels deep. Going beyond this will result in a design error.  4. Variables per Flow Each flow can define up to 250 variables. This includes all variable types (string, inte...

Bulk Import Excel Data to SharePoint List Using PowerShell and PnP

  Managing large datasets in SharePoint can be tricky, especially when you're dealing with Excel files and need to avoid list view threshold issues. In this guide, I’ll walk you through a PowerShell script that efficiently imports data from Excel into a SharePoint Online list using PnP PowerShell — with batching support for performance. Prerequisites Make sure you have the following before running the script: SharePoint Online site URL Excel file with data properly formatted PnP PowerShell module installed ( Install-Module PnP.PowerShell ) Appropriate SharePoint permissions What the Script Does Connects to your SharePoint site Loads and reads an Excel file Converts Excel date values Batches records in groups (to avoid the 5000 item threshold) Adds the items to your SharePoint list or library Logs execution time PowerShell Script $siteUrl = "[Site Collection URL]" Connect-PnPOnline -Url $siteUrl -UseWebLogin # Capture the start time $startTime...

๐Ÿš€ Essential SPFx (SharePoint Framework) Commands for Every Developer

Whether you're new to SharePoint Framework (SPFx) or a seasoned pro, having a go-to list of core commands can significantly improve your development workflow. In this post, we'll walk through the most important SPFx CLI commands—from setting up your environment to packaging and deploying your solution. ๐Ÿ› ️ Setting Up Your SPFx Project Start by scaffolding a new project using the Yeoman generator provided by Microsoft. Make sure Node.js and npm are installed before you proceed. yo @microsoft/sharepoint After scaffolding the project, install all dependencies: npm install To update dependencies later: npm update ๐Ÿ” Trusting the Development Certificate If you're using the local workbench, you need to trust the developer certificate for HTTPS support: gulp trust-dev-cert ๐Ÿงช Running the Local Workbench To build and serve your project locally, use: gulp serve This command starts a local server at: https://localhost:4321/temp/workbench.html You can also test your solution in ShareP...