SharePoint PowerShell tutorials
Automate SharePoint Online and Microsoft 365 with PnP PowerShell and the SharePoint Online Management Shell: connect, manage sites, lists, items and files in bulk, and fix the errors you'll hit along the way.
New to SharePoint PowerShell? Follow these steps
Already working with SharePoint PowerShell? Skip ahead to the topic you need.
Install and connect
Set up PnP PowerShell and sign in to your tenant.
Build sites and lists
Create sites, lists and columns from a script.
Move data in bulk
Load, copy and clean up list items, files and folders.
Administer and troubleshoot
Groups, Teams, labels and the errors you'll meet.
Install and connect
Set up PnP PowerShell and the SharePoint Online Management Shell, then sign in to your tenant.
5 tutorialsSites and site settings
Create sites, list every site in the tenant and read or change site settings.
10 tutorials- How to create and apply a SharePoint site template with PnP PowerShell
- How to get the SharePoint site owner using PowerShell
- How to get SharePoint site members using PowerShell
- How to get the site template in SharePoint using PowerShell
- How to delete a SharePoint Online site using PowerShell
- How to check the SharePoint version with PowerShell
- How to Get All SharePoint Online Sites Using PnP PowerShell
- How to Create a Site in SharePoint Online Using PnP PowerShell
- How to Get SharePoint Online Site Details Using PowerShell
- Hide the 'Return to classic SharePoint' link with PowerShell
Lists and columns
Create lists, add and customize columns, and read list settings in bulk.
7 tutorials- How to get a SharePoint list GUID using PowerShell
- How to Create SharePoint List & Add Columns Using PnP PowerShell?
- 10 Useful Tips for Customizing SharePoint List Fields with PnP PowerShell
- Get SharePoint list column details (internal name, display name, type) with PnP PowerShell
- Add SharePoint List Fields From Excel Using PnP PowerShell
- How to Get All Lists and Libraries from a SharePoint Online Site Using PnP PowerShell
- How to disable versioning in SharePoint Online with PowerShell
List items and bulk data
Create, read, update, delete, copy and bulk-load list items, even past 5,000.
6 tutorials- How to add SharePoint Online list items using PnP PowerShell
- Create, Read, Update and Delete SharePoint List Items with PnP PowerShell
- How to Add More Than 5000 Items to a SharePoint Online List Using PnP PowerShell
- Add Bulk Data from Excel File to SharePoint List Using PnP PowerShell
- How to Delete All Items from a SharePoint List Using PnP PowerShell
- How to Copy Items from One List to Another in SharePoint Online Using PnP PowerShell
Document libraries, files and folders
Create libraries, upload and download files, check what exists and report sizes and permissions.
7 tutorials- How to create a document library with folders using PnP PowerShell
- How to Create and Delete SharePoint Document Library Using PowerShell?
- How to Upload Files to a SharePoint Document Library Using PnP PowerShell
- Download All Files from a SharePoint Document Library Using PnP PowerShell
- How to get SharePoint document library size using PnP PowerShell
- Check if a folder, file, list, column or site exists (PnP PowerShell)
- Get SharePoint Folder Permissions Using PnP PowerShell
Microsoft 365 groups, Teams and compliance
Work with Microsoft 365 group members, Teams and sensitivity labels from PowerShell.
4 tutorialsErrors and fixes
Fixes for sign-in, permission and 'not recognized' errors in SharePoint and Microsoft 365 PowerShell.
11 tutorials- Fix: Connect-PnPOnline is not recognized
- Connect-SPOService: current site is not a tenant administration site
- Connect-SPOService: the remote server returned an error (403) Forbidden
- Register-PnPManagementShellAccess is not recognized
- The term 'Get-SPWeb' is not recognized as the name of a cmdlet
- Get-MsolUser is not recognized
- Connect-MsolService is not recognized
- AADSTS650057: the client has requested access to a resource which is not listed
- AADSTS500113: no reply address is registered for the application
- Exception calling ExecuteQuery with 0 argument(s): unable to connect to the remote server
- We couldn't find the Office 365 group connected to this site
Newest SharePoint PowerShell tutorials
How to Create and Apply a SharePoint Site Template with PnP PowerShell
How to Export Microsoft Teams Chat History Using PowerShell
AADSTS500113: No Reply Address Is Registered for the Application (Fix)
AADSTS650057: The Client Has Requested Access to a Resource Which Is Not Listed (Fix)
PnP PowerShell Scripts for SharePoint Developers
Download All Files from a SharePoint Document Library Using PnP PowerShell
Want a structured path?
Automate SharePoint Online and Microsoft 365 administration with PowerShell 7 and PnP PowerShell, from the basics to bulk scripts. Or see the SharePoint PowerShell career roadmap with the skills, certification and pay for the role.
Keep learning across Microsoft 365
Bijay Kumar
13-times Microsoft MVP · Founder, TSinfo Technologies
Bijay has more than 18 years of hands-on experience with Microsoft technologies, specializing in SharePoint, the Power Platform, SPFx and Microsoft 365. He has trained thousands of developers and IT professionals through SPGuides, wrote “SharePoint Online Modern Experience Practical Guide”, co-wrote “Microsoft Power Platform: A Deep Dive”, and runs the SPGuides YouTube channel. Every lesson comes from real client projects.
Frequently asked questions
PnP PowerShell or the SharePoint Online Management Shell?
Use the SharePoint Online Management Shell for tenant-level admin tasks such as site and sharing settings. Use PnP PowerShell for site-level work like lists, items, files and permissions. Many admins install both.
Which PowerShell version does PnP PowerShell need?
Current PnP PowerShell releases need PowerShell 7.4 or later. The SharePoint Online Management Shell runs in Windows PowerShell 5.1; in PowerShell 7 you import it with the -UseWindowsPowerShell switch.
Why does Connect-PnPOnline ask for a client ID?
The shared PnP Management Shell app was retired in September 2024, so you now register your own Microsoft Entra ID app and pass its client ID. Our connect tutorial shows how to set it up.
Why is Connect-MsolService or Get-MsolUser not recognized?
The MSOnline module has been retired. Use Microsoft Graph PowerShell instead, for example Connect-MgGraph and Get-MgUser. The errors topic on this page covers the replacements.
Can PowerShell work with more than 5,000 list items?
Yes. Paging with -PageSize in Get-PnPListItem and batching with New-PnPBatch let you read and write lists larger than the 5,000-item view threshold.