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 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)
  • Create SharePoint list items using Graph API (PowerShell)
    SharePoint List items do represent a row of structured data in our SharePoint. Besides creating them manually, you have the opportunity to create them programmatically. In this article I want to show you how you can create SharePoint list items using Graph API with PowerShell.
  • How to get SharePoint List Items with Graph API (PowerShell)
    In this article I am explaining how you can get SharePoint List items with Graph API. I took PowerShell to get the items, but you could also get all the items with a web request in the tool of your choice e.g. Postman.

Image sources:

PowerShell icon by Icons8

MS Sharepoint icon by Icons8

Microsoft Sharepoint 2019 icon by Icons8