Need a quick report of all SharePoint lists across your Microsoft 365 tenant? This PowerShell + PnP script from HarjTech helps you generate a CSV of every list in every site. Designed for beginners who need fast, actionable results.
SharePoint administrators are often tasked with producing reports like:
This is especially common when preparing for governance reviews, restructuring initiatives, or compliance audits. Manual collection is too slow and prone to error.
To solve this quickly, HarjTech built a production-ready PowerShell script using PnP PowerShell that loops through all sites, collects every list, and outputs a clean CSV.
This guide walks you through:
Open PowerShell in administrator mode and run the following command to install the module:
Install-Module -Name PnP.PowerShell -Force -AllowClobberWhen prompted to trust the repository, type Y and press Enter.
Use the command below to log in securely. This supports multi-factor authentication.
Connect-PnPOnline -Url "https://yourtenant.sharepoint.com" -InteractiveReplace yourtenant with your Microsoft 365 tenant name.
This script connects to the SharePoint admin center, retrieves all non-personal site collections, and collects data on every list found.
# -------------------------------------------------------------
# Script by HarjTech | www.harjtech.com
# Purpose: List all SharePoint Lists across the tenant
# Outputs: Clean CSV with site title, list name, type, item count
# -------------------------------------------------------------
Import-Module PnP.PowerShell
# Connect to SharePoint Admin Center
$adminSiteUrl = "https://yourtenant-admin.sharepoint.com"
Connect-PnPOnline -Url $adminSiteUrl -Interactive
# Get all site collections, excluding OneDrive personal sites
$sites = Get-PnPTenantSite | Where-Object { $_.Template -ne "SPSPERS" }
# Prepare output array
$report = @()
# Loop through each site and retrieve lists
foreach ($site in $sites) {
Write-Host "Processing site:" $site.Url -ForegroundColor Cyan
try {
Connect-PnPOnline -Url $site.Url -Interactive
$lists = Get-PnPList
foreach ($list in $lists) {
$report += [PSCustomObject]@{
SiteTitle = $site.Title
SiteUrl = $site.Url
ListTitle = $list.Title
ItemCount = $list.ItemCount
ListTemplate = $list.BaseTemplate
Created = $list.Created
LastModified = $list.LastItemModifiedDate
}
}
}
catch {
Write-Warning "Could not access site: $($site.Url)"
}
}
# Export to CSV
$csvPath = "$env:USERPROFILE\Desktop\Tenant-List-Audit-HarjTech.csv"
$report | Export-Csv -Path $csvPath -NoTypeInformation -Encoding UTF8
Write-Host "`nReport saved to $csvPath" -ForegroundColor GreenThe exported file opens in Excel or any CSV-compatible tool.
It includes:
You can filter by:
This script gives you visibility. But governance, cleanup, and restructuring still require planning and execution. That’s where HarjTech delivers.
We help organizations:
Whether you're cleaning up after years of unstructured growth or preparing for an M365 rollout — we can help.
Rapid-build 3 custom Power Apps and workflows tailored to your business needs. Delivered in just 5 days—automated, scalable, and ready to go.
We step into broken, delayed, or chaotic transformation projects and rebuild operational alignment across people, process, and delivery systems.
Clean up Power Platform sprawl with expert-led governance frameworks, secure DLP policies, and scalable environment strategies. Gain clarity, reduce risk, and empower your team safely.


Discover the top tools that enhance your SharePoint ecosystem—covering forms, automation, governance, Teams, Outlook, Power Platform, and more. Whether you're building digital workplaces or streamlining business processes, this curated list helps organizations choose the right tools to maximize productivity and collaboration.

Discover the top tools that enhance your SharePoint ecosystem—covering forms, automation, governance, Teams, Outlook, Power Platform, and more. Whether you're building digital workplaces or streamlining business processes, this curated list helps organizations choose the right tools to maximize productivity and collaboration.





Disorganized documents, disconnected tools, and inefficient workflows are costing construction firms time and profit. Learn how HarjTech helps IT leaders implement scalable, secure Microsoft 365-based systems built for construction operations.

Disorganized documents, disconnected tools, and inefficient workflows are costing construction firms time and profit. Learn how HarjTech helps IT leaders implement scalable, secure Microsoft 365-based systems built for construction operations.


Most small businesses start with Excel and basic tools, but quickly face chaos. This guide shows how to use SharePoint, Teams, Power Platform, and Azure to stay organized, compliant, and ready to scale.


Most small businesses start with Excel and basic tools, but quickly face chaos. This guide shows how to use SharePoint, Teams, Power Platform, and Azure to stay organized, compliant, and ready to scale.


Learn how to manage file uploads in Microsoft Power Pages using either Dataverse or SharePoint. Understand default behaviors, integration requirements, and how to architect secure, scalable solutions for enterprise-grade document handling.

Learn how to manage file uploads in Microsoft Power Pages using either Dataverse or SharePoint. Understand default behaviors, integration requirements, and how to architect secure, scalable solutions for enterprise-grade document handling.


HarjTech used ChatGPT and Microsoft Graph API to build a working Microsoft 365 SaaS dashboard in under an hour—proving that AI can replace expensive, off-the-shelf platforms with fast, secure, in-house solutions.

HarjTech used ChatGPT and Microsoft Graph API to build a working Microsoft 365 SaaS dashboard in under an hour—proving that AI can replace expensive, off-the-shelf platforms with fast, secure, in-house solutions.
Let's discuss how our productized solutions can drive your success
Productized IT Consulting & Digital Solutions. Serving clients across Canada with outcome-driven Microsoft solutions that deliver guaranteed results.
© 2024 HarjTech. All rights reserved.