Welcome to SPO Scripts – your source of high quality PowerShell Scripts about M365 and SharePoint. 

PowerShell is the language when it comes to automation of Microsofts collaboration products. In this blog I want to show you step by step how you can automate things with PowerShell scripts. Main focus is SharePoint, SharePoint Online, Azure.

My aim is to democratize the automation so everybody can make their processes more efficient. 

If you have any cases, where you think I should set up a blog post or you have feedback for me, contact me. I appreciate it.

Jump directly to the PowerShell Script categories


Latest Posts – PowerShell scripts

  • How to Create SharePoint List Items with MS Graph API: A Step-by-Step Guide
    In this article I’ll elaborate how to create SharePoint List Items with MS Graph API. You might have use cases, which require the automatic list item creations – example: Your customer is providing feedback and you want to process it in SharePoint to integrate it to other tools like PowerAutomate. In my current engagement, I am populating demo data to… Read more: How to Create SharePoint List Items with MS Graph API: A Step-by-Step Guide
  • How to create SharePoint Lists with MS Graph
    In this post I want to showcase how to create a SharePoint Library and SharePoint List using MS Graph. You might need to create a SharePoint List with MS Graph if you have scenarios, where you need to ensure that your SharePoint Site is following a strict guideline in terms of predefined lists and libraries. I am currently crafting an… Read more: How to create SharePoint Lists with MS Graph
  • How to create SharePoint Sites using Graph
    In the previous article I was showcasing how to create a SharePoint Site with PNP.PowerShell. In this article I want to elaborate how to create a SharePoint Site with MS Graph. Creating SharePoint Sites with MS Graph can be interesting for integration scenarios as part of a overarching process. Let’s assume, that you want to create a SharePoint Site for… Read more: How to create SharePoint Sites using Graph
  • A Complete Guide For SharePoint Site Creation with PowerShell
    In this article I want to show you how you can streamline the SharePoint Site creation with PowerShell. You can save time by doing it with PowerShell especially, if you want to create multiple sites as part of a backend process. Typical backend processes could be: You have a domain specific process – e.g. as part of each opportunity you… Read more: A Complete Guide For SharePoint Site Creation with PowerShell
  • Assign Sensitivity Labels In SharePoint with MSGraph (PowerShell)
    Sensitivity labels in Microsoft 365 allow organizations to classify documents into categories like public, confidential, or highly confidential. Assigning sensitivity labels in SharePoint with PowerShell involves four steps: enabling sensitivity labels, creating an Azure AD App Registration, enabling metered APIs, and running a script.
  • How to Get SharePoint Files with MSGraph with PowerShell
    Learn how to efficiently retrieve SharePoint files using the MSGraph module in PowerShell. This comprehensive guide outlines the prerequisites, provides a demo setup, and offers a recursive PowerShell script to get all SharePoint files, including folders. Discover how to manage metadata, obtain DriveItem IDs, download specific files, and assess storage in your SharePoint libraries. With step-by-step instructions and code snippets, you can seamlessly integrate MSGraph to streamline your SharePoint file management tasks.
  • How To Download a SharePoint Library Using Graph API (PowerShell)
    SharePoint is a powerful platform for managing and collaborating on documents, but downloading files from SharePoint libraries can be a tricky, especially when it comes to deal with large files or a large amount of documents. In this post, I want to show you a straightforward guide to download a SharePoint Library using PowerShell with Microsoft’s Graph API for SharePoint administrators, develops or system integrators. This tutorial will help you streamline your automation in terms of downloading SharePoint libraries. At the end, you’ll find a ready to use PowerShell script, which you can use to download the SharePoint Library using Graph API.
  • How to download files from SharePoint using Graph API (PowerShell)
    Downloading files from SharePoint is a common use case, when we are integrating 3rd party systems with SharePoint. In my previous articles, I have been explaining how you can upload files to SharePoint using PNP module. In this article, I want to show you how you can achieve download files from SharePoint using Graph API.
  • How to upload files to SharePoint using Graph API (PowerShell)
    Uploading files to SharePoint is a common use case, when we are integrating 3rd party systems with SharePoint. In my previous articles, I have been explaining how you can upload files to SharePoint using PNP module. In this article, I want to show you how you can achieve upload files to SharePoint using Graph API. Note: This method works for… Read more: How to upload files to SharePoint using Graph API (PowerShell)

Image sources:

PowerShell icon by Icons8

MS Sharepoint icon by Icons8

Microsoft Sharepoint 2019 icon by Icons8