If you want to work with SharePoint using PowerShell, then you are at the right place. Here, you will find a list of PowerShell SharePoint tutorials.
You will also learn how to use PnP PowerShell to work with SharePoint Online.
To work with SharePoint using PowerShell or PnP PowerShell, you need first to install SharePoint Online Management Shell or PnP PowerShell. You can check How to Connect to SharePoint Online using PowerShell and PnP PowerShell?.
While connecting to the SharePoint site, you might encounter this error also Connect-SPOService : Current site is not a tenant administration site.
PnP PowerShell SharePoint Tutorials
Below are all the PnP PowerShell SharePoint tutorials with examples. I have separated them by SharePoint site, list, and library.
SharePoint Site Tutorials (With PnP PowerShell)
This is the section where you will find all the PnP PowerShell SharePoint site tutorials.
A SharePoint Online site is a web-based platform provided by Microsoft, designed for collaboration, document management, and information sharing within organizations. SharePoint Online is a part of Microsoft 365. So, if you have a Microsoft 365 license, you can access SharePoint Online.
SharePoint Online sites can be accessed from any device, anywhere, at any time.
Each SharePoint Online site serves as a secure place to store, organize, share, and access information. Sites are often used to create intranets, project management spaces, or departmental hubs where team members can collaborate on documents, track project progress, and share updates.
Users can create pages, document libraries, and lists, and they can customize these with web parts to display important visuals, news, and updates
Now, check out all the related PnP PowerShell tutorials related to SharePoint sites.
| Tutorials | Descriptions |
|---|---|
| Create a SharePoint Online site using PnP PowerShell | Shows how to create Team and Communication sites in SharePoint Online using PnP PowerShell. |
| Delete and Recover a SharePoint Online Site Using PowerShell and PnP PowerShell | Explains how to delete sites, send them to the recycle bin, and restore them using PowerShell and PnP PowerShell. |
| Get All SharePoint Online Sites using PnP PowerShell | Retrieves all SharePoint Online sites in a tenant with PnP PowerShell, including key properties. |
| Enable Custom Script in SharePoint Online Using PnP PowerShell | Demonstrates enabling or disabling custom script settings for SharePoint Online sites via PnP PowerShell. |
| Get All Lists and Libraries from SharePoint Online Site using PnP PowerShell | Lists every list and document library in a given SharePoint site using PnP PowerShell. |
| How to Check if a SharePoint Site Exists using PnP PowerShell? | Shows how to verify whether a specific SharePoint Online site exists before operating on it. |
| How to Get SharePoint Site Creation Date using PnP PowerShell? | Retrieves the creation date for a SharePoint Online site with PnP PowerShell commands. |
| How to Get SharePoint Site ID using PnP PowerShell? | Explains how to get the GUID/ID of a SharePoint Online site for use in scripts or APIs. |
| How to Change a SharePoint Site URL Using PnP PowerShell? | Walks through renaming and changing the URL of an existing SharePoint Online site with PnP PowerShell. |
| How to Get SharePoint Online Site Details Using PowerShell? | Shows how to pull detailed site information (storage, template, owners, etc.) using PowerShell. |
SharePoint List & Library Tutorials (With PnP PowerShell)
A SharePoint list is a collection of data that is organized in rows and columns, similar to a table in a database or a spreadsheet in Excel. Lists are used to manage and store non-document information, such as tasks, contacts, or events.
Each row in a list is called a list item, and each column is referred to as a field or property. Lists are highly customizable, allowing users to add various types of columns, such as text, numbers, dates, and choice fields, to suit their specific needs.
Examples:
Let me give you a few examples to understand a SharePoint Online list in a better way.
- Employee Onboarding List: This list can track the onboarding process for new hires, including tasks such as completing paperwork, setting up equipment, and attending orientation sessions. Columns might include Employee Name, Start Date, Task Description, Assigned To, Due Date, and Status.
- Customer Feedback List: A list designed to capture feedback from customers about products or services. Columns could include Customer Name, Contact Information, Feedback Date, Feedback Type (e.g., Complaint, Suggestion, Praise), Feedback Details, and Follow-Up Status.
- Inventory Management List: This list helps manage inventory levels for a business. Columns might include Item Name, Item Code, Quantity in Stock, Reorder Level, Supplier, and Last Updated Date.
A SharePoint library, on the other hand, is a specialized list designed to store, organize, and manage documents and other files. Libraries provide a structured environment where users can upload, create, update, and share files with team members.
Each file in a library is an item, and libraries can include metadata columns to categorize and describe the files. SharePoint libraries support versioning, check-in/check-out functionality, etc.
For libraries, also let me give you a few examples.
- Marketing Library: A library for storing marketing materials such as brochures, flyers, and presentations. Metadata columns could include Document Type, Campaign Name, Target Audience, Creation Date, and Author.
- Research Papers Library: A library for storing academic or industry research papers. Columns might include Title, Author(s), Publication Date, Abstract, Keywords, and Journal Name.
- Project Documentation Library: This library can store all documents related to specific projects, such as project plans, meeting minutes, and reports. Metadata columns could include Project Name, Document Type, Version, Approval Status, and Last Modified Date.
Now, here is the list of PnP PowerShell tutorials related to SharePoint lists and libraries.
| Tutorials | Descriptions |
|---|---|
| Create a SharePoint Online list using PnP PowerShell | Shows how to create a new SharePoint Online list using PnP PowerShell with required settings. |
| Create, Read, Update, and Delete an Item from a SharePoint Online List using PnP PowerShell | Demonstrates full CRUD operations on SharePoint list items using PnP PowerShell. |
| Disable Versioning in a SharePoint Library Using PnP PowerShell | Explains how to turn off versioning for a document library via PnP PowerShell. |
| Delete All Items from a SharePoint List using PnP PowerShell | Shows how to bulk delete every item in a SharePoint list safely with PnP PowerShell. |
| Add More Than 5000 Items to a SharePoint Online List using PnP PowerShell | Covers adding over 5000 items to a list while handling the list‑view threshold. |
| Import Data from Excel to SharePoint List using PnP PowerShell | Imports rows from an Excel file into a SharePoint list using PnP PowerShell. |
| Get Count of Items in SharePoint List using PnP PowerShell | Retrieves the total item count from a SharePoint list using a PnP PowerShell query. |
| Copy Items from One List to Another in SharePoint Online Using PnP PowerShell | Shows how to copy items between two SharePoint lists, preserving key field values. |
| How to Check if a List Exists in SharePoint Site using PnP PowerShell? | Verifies whether a specific list exists in a site before performing operations. |
| How to Check if a Folder Exists in SharePoint Online using PnP PowerShell? | Explains how to check for the presence of a folder within a library using PnP PowerShell. |
| How to Upload Files to a SharePoint Document Library using PnP PowerShell? | Demonstrates uploading one or multiple files into a document library with PnP PowerShell. |
| How to Download Files from SharePoint Document Library Using PnP PowerShell? | Shows how to download files from a SharePoint document library to a local folder. |
| How to Get All List Fields in SharePoint Online using PnP PowerShell? | Retrieves the definitions of all columns/fields in a SharePoint list using PnP PowerShell. |
| How to Check if a File Exists in a SharePoint Document Library Using PnP PowerShell? | Checks whether a specific file is present in a SharePoint document library. |
| How to Check If a Field Exists in a SharePoint Online List Using PnP PowerShell? | Verifies if a particular column/field exists in a list before using it. |
| An error occurred while enumerating through a collection. The collection has not been initialized | Describes the cause of this enumeration error in PnP/CSOM scripts and how to fix it. |
| How to Add a Choice Column to a SharePoint Online List Using PnP PowerShell? | Shows how to create a choice column with options on a SharePoint list using PnP PowerShell. |
| Create Folder & Subfolders in SharePoint Online with PnP PowerShell | Demonstrates creating nested folders and subfolders in a document library via PnP PowerShell. |