Authenticate with and call the Microsoft Graph
Obtain a new access token for the Microsoft Graph and use it an HTTP request, or connect to the Graph
Microsoft 365 & Power Platform Community
A little script. A lot less work.
Real-world scripts for Copilot, Microsoft 365, Power Platform and more.
Find a starting point, choose your tool, and make it your own.
Small scripts. Big possibilities.The script library
Obtain a new access token for the Microsoft Graph and use it an HTTP request, or connect to the Graph
Update Hero Link sharing settings
Create a Microsoft Entra security group that does not allow other groups to be added as members, using Microsoft Graph PowerShell.
How to reset hero link
Update Hero Link to 'Only people added to the file have access'
Get Hero sharing links.
Get a report from the last 2 weeks, useful for maintainers who regularly have contributions and want to see a summary of recent activity.
Automate Power Platform solution deployment between environments with configurable validation checks before import.
Inventory every SharePoint Embedded container in the tenant (active, archived and deleted) with owning app, storage and sensitivity label, and export it to CSV.
Identify duplicate values in a SharePoint list column and export them to a CSV report using PnP PowerShell.
Bulk rename SharePoint Online files from a CSV and create an audit report.
Permission discrepancies between Teams and SharePoint sites.
This script inventories calendar permissions across Exchange Online mailboxes and exports delegate identities, access rights, and sharing flags to CSV.
This script identifies Exchange Online mailboxes without an enabled archive and exports the results to a timestamped CSV report.
Restore deleted Microsoft 365 Groups and Entra ID Security Groups in bulk using Microsoft Graph PowerShell.
Hide the SharePoint list from the UI this script will hide a specific list from the site contents
Reports how many documents in a site are unlabeled - the content Microsoft Copilot would surface with no sensitivity classification - and ranks the gaps worst-covered library first.
A schema diff for SharePoint. Reports exactly what drifted between two sites (or a baseline versus a live site): lists only on one side, and per-column Added, Removed, or Changed.
Get an list of all the app descriptions to determine if your app may clash with others during Copilot development
Node.js script to install SharePoint Framework (SPFx) development environments with correct Node.js versions and build tools using fnm.
Node.js script to list SharePoint Framework (SPFx) versions installed via fnm with their Node.js versions and optionally query available versions from npm.
Audits an Entra dynamic group by reviewing its membership rule and processing status, along with the current member count.
Get a list of SharePoint Agents from SharePoint Online site and export agent metadata and contents to CSV.
This script assesses Deleted Items and Recoverable Items storage across Exchange Online user mailboxes and exports the highest-consuming mailboxes to CSV.
This script connects to Exchange Online, lists user mailboxes, calculates mailbox sizes, and exports the largest mailboxes to a CSV report.
Offboards an Entra user by removing their access and permissions.
Bulk-sets the expiration date on Teams meeting recordings already stored in OneDrive or SharePoint using File.SetExpirationDate, the only write path for the read-only _ExpirationDate column.
Lists all custom connectors in a tenant with owner, auth type and endpoint
Generate a tenant-wide report of SharePoint Hub Sites, associated sites, site collection administrators, and execution audit details using certificate-based PnP PowerShell authentication.
Audits SharePoint Online page libraries and classifies ASPX pages as Modern or Classic.
Audits distribution groups that allow messages from external or unauthenticated senders and exports the results to CSV.
Adds delegated or application API permissions to an Entra app registration using Microsoft Graph.
Finds every sharing link on a SharePoint Online site through the hidden SharingLinks groups, resolves them to files, and risk-rates each one (Anonymous / Organization / Users, View / Edit, expiry, password) so you can spot oversharing before Search and Copilot surface it.
Report who can reach a SharePoint Online site and how, or what a given user can reach, classifying every route as Granted or Overshared (Everyone claims and sharing links).
The script will report inactive users for x days and provides an option to delete them.
Analyze Teams meetings to report on Copilot usage.
Audit SharePoint Online access request settings across site collections and subsites.
Disable the Add Shortcut to OneDrive feature at the SharePoint Online tenant level using certificate-based authentication.
This script identifies users who have been granted direct permissions on SharePoint Online sites, rather than receiving access through groups.
This PowerShell script connects to the SharePoint Online Admin Center using certificate-based authentication and audits all SharePoint Online site collections to identify sites where Custom Script is enabled. The results are exported to a timestamped CSV report for audit purposes.
Generate an inventory report for a SharePoint site including lists, libraries, pages and storage information
Create Hub Navigation from Teams and Channels
This script copies selected SharePoint list fields from a source list to a destination list using PnP PowerShell and certificate-based authentication.
Find site collection administrators granted for support cases and remove them once support is complete
This script connects to Exchange Online, identifies shared mailboxes over a size threshold, and exports a CSV report for governance and capacity monitoring.
This script identifies all Exchange Online mailboxes configured with email forwarding and exports the results to a timestamped CSV report.
Validates the multilingual translation metadata (_SPTranslatedLanguages, _SPTranslationLanguage, _SPTranslationSourceItemId, _SPIsTranslation) of every page in the Site Pages library and optionally corrects clear-cut misconfigurations.
Reports on file version history across Microsoft Teams sites and private channels, calculates storage savings, and trims expired versions using SharePoint's automatic versioning policy.
Find the user accounts which have been disabled or are inactive, export report to CSV
This function, Request-PnPReindexUserProfile, triggers a full crawl of each user's profile properties.
Export TopNavBar Nodes with Childrens and Title Translations.
Find Teams and Channels associated with a SharePoint URL
Generate a tenant-wide CSV report of Microsoft 365 Group-connected SharePoint sites, ownership, and Microsoft Teams linkage.
Generates a tenant-wide report of first and second stage recycle bin usage, retention windows, and upcoming purge dates across SharePoint Online site collections.
Analyze Microsoft Entra Conditional Access policies and export an impact assessment report before policy changes are made.
Identifies OneDrive for Business users who are over their expected storage quota based on their assigned license tier, with special handling for EDU A1 enforcement.
Exports SharePoint Term Store groups, sets, terms, and multilingual labels to CSV, JSON, or both.
Create library using Out-of-the-Box SharePoint Library template
Updates a SharePoint site's available languages by keeping only the specified languages enabled.
Identify which users have security roles assigned directly vs via Dataverse Group Teams - useful for compliance reporting
This script enables AI skills in SharePoint Online by activating the Agent Assets site collection feature
Uploads a custom SKILL.md file to the Cowork/skills folder in a user's OneDrive Agent Assets library using PnP PowerShell.
Upload a SKILL.md file into the SharePoint Agent Assets > Skills folder for a target site.
This script will get all flows in your default environment and export them for importing back into Power Automate
How to Set SharePoint File Versions to Never Expire Using PowerShell.
This script sample shows how to get permission for list/library and export it to CSV with some required details
Export and Import TermGroups between Tenants or save the export as backup.
Remove a SPFx Solution from every Site installed, from Recycle bin and from App Catalog. This is needed if you need a complete cleanup or reinstall.
SharePoint Search versus crawl log
These scripts are part of the Microsoft 365 Consultant's Script kit - OneDrive, SharePoint and Custom Site Scans
This script connects to Exchange Online, enumerates mailboxes, and reports FullAccess, SendAs, and SendOnBehalf delegates.
Removes MFA authentication methods (phone, Microsoft Authenticator, software OATH token) for all or specific users in a Microsoft 365 tenant using Microsoft Graph PowerShell.
This sample shows how to copy files between different SharePoint libraries with custom metadata with a matching folder structure.
This script identifies users in a Microsoft 365 tenant who are not effectively protected by Multi-Factor Authentication (MFA).
Demonstrates how to audit and revoke Entra ID app permissions across SharePoint site.
This script identifies shared mailboxes that have no assigned owners or members by analysing mailbox permissions in Exchange Online.
Apply a theme to a specific SharePoint site without adding a tenant theme that would be available for all sites.
This script will compare files hash from two different SharePoint tenants
This script sample shows how to export all site pages details from Site Pages library.
This PowerShell script enumerates users in Microsoft Entra ID (formerly Azure AD) and retrieves their **Multi-Factor Authentication (MFA) / phone authentication methods** using Microsoft Graph.
This script identifies SharePoint Online sites that have had no content activity for a defined period (default: 365 days) and generates a CSV report containing site metadata.
This script audits all SharePoint Online site collections in a Microsoft 365 tenant to validate site ownership.
This script migrates messages and files from one channel to another.
This script audits all privileged Entra ID directory role assignments across a Microsoft 365 tenant
Exports every OneDrive in the tenant, and the site collection admins. Audit which admins have access to user OneDrives.
Identify guest users within a Microsoft 365 tenant who have elevated permissions across various services such as Entra ID, Microsoft Teams, and SharePoint Online.
This script provides you the list of active sites in your tenant with their administrator and usage in MB
Debugging SharePoint Search by inspecting crawl log
This sample script shows how to change SharePoint online list URL and rename the list after list creation using PnP PowerShell
Find the user accounts which no longer is valid, export report to CSV
This will scan every SharePoint site (or OneDrive URL) and look at every item. When it does this, it will check the retention label for said item.
We decide we want to trim away a few of the Site Columns we've created, here is the script that does just that
This sample shows how to add dummy folders and files into a SharePoint library, generating files within folders to perform testing.
Script to create site columns and add them to content types
Ensuring m365 group owners are m365 group members
Find all the Microsoft 365 Groups that a user is an Owner of and replace them with someone
This PowerShell script exports Microsoft 365 users — including properties into a CSV file using the Microsoft Graph API.
A secure, user-friendly PowerShell script to clone all accessible Git repositories from an Azure DevOps organization
This script checks SharePoint sites and specific list, removes old webhook URLs, and adds or replaces them with updated Power Automate webhook subscriptions.
Removes or disables all comments in a site collection including by user
Identify all your Remote Event Receivers in SharePoint Online before they are deprecated.
Updates a SharePoint Online lookup column to reference a lookup list
This script Gets all the flows with Http Request Received as Trigger
This script identifies and deletes empty folders in a SharePoint document library using PnP PowerShell
This script allows you to add a SharePoint Document Library as a Tab in Microsoft Teams.
Apply Out-of-the-Box SharePoint Site Designs to Existing Sites
Migrate SharePoint list to new content type while preserving all existing data
This script creates a basic FAQ page in SharePoint using a CSV file as the source.
Exporting and Migrating SharePoint Libraries with Folders.
Converting SharePoint Sharing Links to Canonical URLs
Script prompt/import/export of embeddings, actions, prompt libraries.
Auto-collect stale Teams/sites, label stats, Purview scans using CLI for M365, Graph PowerShell, and Azure CLI
Sometimes, there's a need to restore files that were accidentally deleted by users.
List all SPFx field customizers
This sample script shows how to enable modern creation forms for Document sets in SharePoint online site.
This script deletes all site in a Hub and finally the Hub site itself
This PowerShell script scans your SharePoint Online environment and exports a list of all classic SharePoint Alerts configured by users across all site collections.
How to Safely Rename a SharePoint Hub Site URL
This script lists all shared channels across Teams, identifies external tenant connections, and generates a detailed report.
This script will update a specific Content type from the Hub on the sites where it is used
This script streamlines the setup of Document Sets across multiple libraries by enabling the feature, customisting and integrating into document libraries.
This script exports Conditional Access Policies to JSON, stores them for version control, and detects changes between runs.
Export duplicate files from SharePoint Online document libraries.
This script enumerates all access-review definitions, triggers overdue reviews, polls for completion, and exports decisions to CSV for audit.
Deploy and activate the Microsoft Clarity SPFx application customizer to a specific set of sites listed in a csv for a Microsoft Clarity project.
This sample deploys multiple Copilot Teams Toolkit declarative agents in bulk using PowerShell and Teams Toolkit CLI.
This script generates a Teams Copilot Declarative Agent and overlaps a template with value replacement
Updating Multiline Text Field Properties in SharePoint
Bash script to install custom version of NodeJs (using nvm) and dependencies for any version of SPFx.
Retrieve Effective Permissions of an user within SharePoint Sites
The script enables and configures Document ID within a SharePoint site
Pinning Fields to the Filter Pane in SharePoint Libraries.
Understanding how a SharePoint site was created is crucial for governance, compliance, and troubleshooting. In Microsoft 365, SharePoint sites can be created through various methods, such as Microsoft Teams, Viva Engage, the SharePoint Admin Center, and more. However, identifying the exact creation source can sometimes be challenging.
This sample script demonstrates how to hide real-time viewing information in Microsoft Lists.
Scanning document libraries and reporting on those that contains 1 or more webhooks
Demonstrates how to retrieve sent email campaigns from MailChimp, and save them as wiki pages on SPO. The script retrieves the HTML content of the email, downloads all images into a local folder and uploads to a SPO document library, replaces all mccontent image tags to point to SPO, and create and publish a wiki page
This sample shows how to use both OpenAI and document intelligene studio to process and extract data in a json format
Deletes expired and older sharing links for folder, file, and item. Currently expired or older sharing links are not automatically deleted
Dyanmic creation of SharePoint Agents (.agent files) using PowerShell. Specify instructions, sample prompts and ground on files, folder, libraries or sites.
Deletes company-wide and anonymous sharing links for folder, file, and item. This can address oversharing issues during the M365 Copilot rollout.
This script retrieves and stores SharePoint site pages viewers' details.
This PowerShell function will download all documents from all document libraries in a site, including version history. The documents will be saved in a folder structure that matches the library structure.
This sample shows how to copy a document library including files and folder structure from one tenant to another one. It includes a resume functionality which comes handy for large libraries. Additionally you can specify custom properties which shall also copied to the target.
This script can help to identify the SharePoint Urls associated to private and shared channels. For example, eDiscovery when running against 'Specific Locations' or just for reporting purposes
Identifying duplicate M365 Group to ensure each group has a unique name can help to reduce confusion for end users.
The script retrieves information about a site's default group memberships and administrators for SharePoint admins, without requiring permissions for specific SharePoint sites
This script iterates through a list of site URLs provided in 'sites-test.csv'. For each site, it then scans these page contents for embedded href tags using regular expressions.
This script takes an input file containing one or more SharePoint Online Site Collection Object IDs and converts them into the full URLs
Configuring Microsoft 365 Group settings is essential for ensuring a secure and compliant environment. This script can be utilized to set up different group settings, such as naming policies and guest access.
Audit 'Everyone' and 'Everyone except external users' claim within a SharePoint site
Shows how to export data from MS Search, in this case the entityType externalItem
Retrieves a SiteId from Microsoft Graph using PnP PowerShell. This can be particularly useful when making further API calls that require the SiteId.
lock and unlock a file which is a record in SharePoint Online using the Microsoft Graph API through PnP PowerShell. The script retrieves the drive id and drive item id before calling the endpoint to lock or unlock a file.
These are 2 practical scripts to get Tenant ID from either a domain name or from a Subscription ID.
Automate Renewal of Expiring M365 Groups or or Microsoft Teams teams
Get SharePoint site sharing settings including some SharePoint Advanced Management(SAM) settings
Prevent Guests from Being Added to a Specific Microsoft 365 Group or Microsoft Teams team
This PowerShell script downloads the latest [Bootstrap icons](https://icons.getbootstrap.com/) from [twbs@github](https://github.com/twbs/icons/releases/latest), creates a JSON file with the complete list of SVG icons you can use.
Get a full report of the number of files in your environment
Easily identify ownerless teams in your tenant
A sample showing you how to change the color or the icon of a list in SharePoint
Showing how you can add your own document templates to the the New dropdown in a document library
The script will download all files from an SharePoint Document Libraray or Folder
Get Files with Retention or Sensitivity Labels in SharePoint Online
Get M365 Groups, SharePoint Groups, direct permissions and sharing links including unique permissions up to item level
This script creates an overview for The total amount of SharePoint Storage, and how much could be saved by trimming the versions.
This script identifies the SharePoint sites that a Service Principal can access when the sites.selected API permission is granted.
This script sample shows how to register an app in SharePoint and login to SharePoint using the app.
This script is designed to help administrators monitor the availability of Microsoft 365 licenses for specific SKUs
This sample shows how to delete a number of file versions to reduce SharePoint Storage
This script can be used to grant System-Managed Identity used by automation (Azure Runbook, Azure Functions) API permissions and access to SPO sites
This script removes unused API permissions assigned to the 'SharePoint Online Client Extensibility Web Application Principal'.
Locate use of Modern Script Editor
This is a Content type pre-burner before extracting a PnP Template
To enhance your tenant's security posture, it's crucial to regularly review the API permissions requested by SPFx solutions
Retrieve detailed information about SPFx solutions installed in SharePoint environment, such as API permissions from both the tenant-level and site collection app catalogs.
Understand and sharing links activities within your M365 environment is crucial for maintaining security and compliance.
Understand and sharing links activities within your M365 environment is crucial for maintaining security and compliance.
Remove the link in the left hand side suggesting to convert a Group Site to a Teams site
Update SharePoint Site Logo and Thumbnail.
Find SharePoint Framework (SPFx) Packages in Tenant and Site Collection App Catalogs which will help maintain oversight of SPFx package installation, ensuring they are up-to-date and compliant.
Demonstrates how to update a SharePoint list item without changing the Modified By and Modified fields using PnP PowerShell.
Deletes sharing links for folder, file, and item. This can address oversharing issues during the Copilot for M365 rollout.
As a site owner, delete in bulk all the access requests from a SharePoint site.
Script to replace all the Power Automate flows where someone is owner of
Locate all lists where a Term is being used and force a reindex
This sample script deletes specified SharePoint Online sites that have a retention policy applied by excluding them from the retention policy, deleting the site and then cleaning up the retention policy exclusions.
This script will fix the IdMismatch of a user across all sites.
Retrieve an existing structure of a SharePoint Online (SPO) tenant
Retrieves all files properties within a specified folder.
Locate all instances of Managed Metadata where the connected Termstore Term has been deleted
This sample shows how to query CSOM properties with PnP PowerShell by writing C# code, importing it in PowerShell and sending a single Invoke-PnPQuery request
Trim the file versions and archive the site using Microsoft 365 Archive
Deploying SPFx Packages from Tenant App Catalog to Hub Site and Associated Sites
Retracting SPFx Solutions from Hub Site and associated sites
Get custom Fields within lists and libraries within a site.
Sample shows how you can delete Microsoft 365 Groups and associated SharePoint Online sites in your development environment
Looks for site collections where the home page has custom permissions and outputs to a CSV file.
This script exports all content types available on a SharePoint site to CSV.
This script exports the SharePoint site hierarchy into a Markdown file to visualize the hub sites and its associated sites.
How to access complete term store hierarchies across all levels?
Keeping your SharePoint environment up-to-date is crucial, especially after making schema changes - this script streamlines the process of reindexing sites, libraries, or lists.
This script copies a hub navigation from any hub site (source) to another hub site (target)
Expiring tenant or need to understand what you have created in the past, report and optionally export your projects and solutions
Understand and track activities within your M365 environment is crucial for maintaining security and compliance.
This sample script shows how to register a SharePoint document library as an organization assets library.
This sample script shows how to remove a SharePoint document library from organization assets libraries.
The script downloads all files from array of documents urls and archive them to a zip file
This script will create the folders (not nested) into the libraries provided in the CSV file.
Add bulk users to SharePoint site groups from CSV.
Replaces specific users in the People web part
Get all hub site main sites and navigation nodes using PnP PowerShell and update nodes if required.
This script sample how to export all the PowerApps details and its role assignment in csv format
Bulk remove all retention labels from all files in a library that are labelled with a retention label. These files will now no longer be tagged with a retention label
Control the sites and libraries that get crawled. Also useful for Copilot projects to chose which areas to include
This script shows who to export a folderstructure to a JSON file, and import the folder structure into another library
This script sample shows how to get checked Out files including those with no checked in version
This sample shows how to Hide the 'See All' Button in the Highlighted Content Web Part using PnP PowerShell
Exports the installed apps in Microsoft Teams teams
Retrieve team information such as team name, ID, owner, channels, etc., and export it to CSV using Microsoft Teams PowerShell.
This script guides how to rearrange content types in a SharePoint list using PnP PowerShell.
Sample script to create a lists of all apps in your tenant and exports to CSV
Disable Web Templates Gallery First Run Dialog
You can use my Script as a base to build your own automation for testing flows.
Export the text content of SharePoint Online modern pages as HTML files for analysis with tools that do not connect to SharePoint.
This sample script will show you how to disable the Quick property editing (Grid view) from SharePoint list.
This script shows how to send a delayed message with the Microsoft Graph PowerShell SDK
Exports the log of direct routing calls for a given duration
Exports the log of PSTN calls for a given duration
This script helps you in creation of SharePoint Online Communication and Team sites in bulk. It takes an input from CSV.
Get all lists and Libraries along with total Item count and permissions and export it in CSV
The script streamlines the process of updating user photos of images stored locally. It ensures efficient handling of both successful updates and errors, providing an organized approach to managing user photos within Microsoft 365
This script lists and archives all the inactive teams
The script export site membership details to a CSV file
A script that let's you easily backup all custom formatting on a site
This script adds a new language to the SharePoint Online site with the help of language LCID decimal.
Using Azure Open AI and Azure Cognitve Search with Semantic Index, this example shows how you can call the AI service with your own data.
Tracks the list of people who edit each file and exports the complete list of editors in the library. This allows us to identify users who shouldn't have editing rights or those who edited files only occasionally and then stopped.
This PowerShell script will export the teams channel conversations to an HTML file with expand collapse feature based on Teams and channel.
This script exports all inactive sites based on certain number of days to CSV.
Find the pages where a v3 of PnP Modern Search web parts have been used, export report to CSV
Script to create SharePoint document library and add custom content type
This sample code creates a Colored Folder in a SharePoint document library.
Find a specific Web part in pages or templates, for example, defualting to and finding Twitter Web parts
Script to copy SharePoint list to a different site
This scripts gets the report of sites in a tenant which is having unique permissions
This is example script how to add SharePoint Framework package to the app catalog using Microsoft 365 CLI and Azure AD app certificate.
This sample shows how to efficiently update a large SharePoint list of 60,000 or more items using PnP-Batch, significantly reducing update time.
This script will delete items from recyclebin in bulk while avoiding List View Threshold issues.
Get storage breakdown by file size, file version size and recycle bin.
This function detects the graph version and connects accordingly
Changes the MUI setting for a user within the User Information List
Deploys and Installs SharePoint Framework (SPFx) solutions to Hub Site and Associated Sites
This script show the date of the most recent update
This sample shows how to use OpenAI's function calling feature and get status of a TfL line.
This script allows you to associate Form Customizer Extension to List/Library via Content Type properties
Remove the delete option on a document library to prevent users from accidentally deleting libraries
This script connects to Micrsoft Graph and searches all Microsoft E3 Licenses for YAMMER_Enterprise licenses. It will then deactivate the Yammer license within Office 365, it can be used to remove other Office 365 licenses as well
Reset bulk file permissions from unique to parent folder inheritance.
This script retrieves the version history of a specified list item, including all field values or only selected fields
This sample script shows how to allow use of custom scripts in SharePoint online at site level
This script allows you to list all Teams team's owners and members and export them into a CSV file.
This script helps SharePoint Users to Enable or Disable App Bar Across SharePoint sites
Add/Update image in SharePoint image column in a SharePoint List or Library
Creating a lot of beautiful themes lately and testing them but don't want to keep them anymore, this script is for you
The script downloads all content type document template files in a library
Find items where the permissions have been broken
This script shows how to create multiple groups in SharePoint for different site collection providing input from CSV file.
Script that removes sites from the tenant recycle bin
Scan through modern pages and reports out the URLs in the quick links web parts
Ensure that office documents will open in the desktop client application if such is installed
This sample script shows how to disable commenting feature in SharePoint online lists at tenant level
This PowerShell script can be used to associate mutilple site collections to Hub site. You can provide list of site collection URLs in an array.
This sample script shows how to Activate a site feature in SharePoint online site.
This sample script sets a communication site as a home site for SharePoint online tenant
This sample script shows how to add a page template to a SharePoint Online site collection
This sample script shows how to remove the title area from SharePoint online site page using PnP PowerShell and CLI for Microsoft 365.
This sample script shows how to update the banner image at the top of the SharePoint online modern page using PnP PowerShell
Deploy certain SharePoint solution to a specific site
Remove Site designs and site scripts that ends up just hanging around in your tenant. Use the scripts below to get rid of them
This sample script shows how to empty SharePoint online site first stage and second stage recycle bin
Remove Site scripts that ends up just hanging around in your tenant. Use the scripts below to get rid of them
This sample script shows how to disable commenting feature in SharePoint online lists at list level
Download all packages from App Catalog
Get Content Type usage within a site collection.
This sample script shows how to apply SharePoint JSON view formatting using PnP PowerShell and CLI for Microsoft 365
Getting checked-out files in the tenant using Search
This sample shows how to export all or a sub set of accounts from UPA to CSV
Sometime you are required to create a site including some specific files and/or list items. You can do this in servaral ways, but in this sample we are using the PnP Provisioning Engine
Create test users with chat and GPT or use predefined list of users
Locate all Teams having a Wiki and export the list to CSV
This sample demonstrates how to use Microsoft Graph PowerShell SDK and Open AI API to generate a multilingual summary of a SharePoint page.
This script helps M365 admin to provision follow SharePoint Online sites to users and display in Out of the box SharePoint Site /_layouts/15/sharepoint.aspx?v=following.
Sample showing how create a PnP Template and ADD parameters then use Invoke-PnPSiteTemplate with parameters
Script will export SharePoint Library with access shared links files to CSV file.
Pinpoint the items/docs that hasn't been indexed yet since the last time the item was updated
This script can be used to send bulk emails to multiple users from CSV file on behalf of user
Script that bulk imports data from multiple files
Sample showing how to ensure that the Role/Title in each People web is updated
Simplifies the process of granting FullControl or Manage permissions for an application registration in a SharePoint site collection
This sample script helps you understand how many Stream (Classic) Web Parts are being used by your site by outputting a CSV file of the Stream (Classic) Web Parts and the pages that use them.
This script allows you to retrieve Message Center announcements and post to MS Teams channel.
Script that creates site design based on existing site with permissions
Lists all the places where a specific Term ID is used
Script to download files in a doclib to a local drive and convert Office Documents to PDF
Enable page scheduling on a modern site pages library
Create AD app, add permissions and connect to SharePoint
Sample for when you need to work with documentsets in SharePoint
Script will create dynamic user groups based on the user having an enabled license for each application
Enable Site Collection App Catalog on list of SharePoint sites from CSV
Deploy all packages from a local folder and install the apps to the SharePoint site.
Uploads a large file to SharePoint using MS Graph REST API
Sample showing how to extract the employees shown on modern pages in a selection of Site Collections
Sample showing how to extract the employees shown in the People Web part on pages in a selection of Site Collections
Sample showing how to use extract the configuration of a PnP Modern Search results web part and apply it on another site collection
This sample builds 9 SharePoint communication sites, creates three hub sites and associates them to a main hub site
Remove modern web parts from pages by their Id, Instance Id, or Title
This sample shows how you can generate a set of demo content from a website such as Wikipedia.
Sample showing how to export basic site collection properties to a CSV file for stakeholders which do not have access to the SharePoint Admin Center
Copies the folder structure of a directory to a SharePoint list and trigger an migration using the Migration Manager
This script will scan the ULS Logs for the last week looking for all access by a user an or to a site and create an excel file summarizing the activity
There will be cases where you want to delete all resources from a resource group. This would typically be used if you want to clean up the resource group after a test run.
This script exports all onedrive sites to CSV
Script to clean up temporary pages from Site Pages library
Locate all the pages where a classic SearchResultWebPart is used, and if the Remove Duplicates setting is True (which is the default) log the location in the csv file
This sample script shows how to change the placeholder text in SharePoint online search box for a given (sub) site and/or for all the sites in a site collection.
The script updates content type of files in folder with system update.
Export SharePoint Term Store terms to CSV
This script will create Content Type Hub with custom calendar List field formatting and include in destination site and associated custom List
This script will enable you to create a Quick Links web part where the items are defined in some kind of data source
Obtain a report via the Microsoft Graph to extract the license and last signedin information to support a license review, for others to help remove any unused users
When connected to a site with Connect-PnPOnline this script will walk through the site's document libraries, list each file, when it was created and by whom, and when it was last modified by whom
Examples of common operations covering installation, authentication, permissions, differentiate between endpoints, CRUD operations are more...
With the new 120 day expiration meeting recording policy - what do you do if you need to recover across thousands of accounts.
This script monitors your SharePoint health status and sends a notifications to a Microsoft Teams channel.
Export checked-out files in all sites associated with a hub site to CSV
Get any existing delegated or application permission info associated to a Microsoft AAD app from its name
Restores Recycle bin items from CSV file in batches
Add a document library web part to a page (and only show a specific folder)
This script uses PnP Powershell to extract the template of one SharePoint site and invoke it on another site
This script sample will publish Syntex Document Understanding Models to many libraries using the batching functionality of PnP PowerShell.
Update web part properties on modern pages
With this sample, you can copy an existing plan to a certain group.
Script helps you to list all external users in all SharePoint Online sites
The script shows in what site groups external users are added in all SharePoint Online sites
Scan through modern pages within a site and reports out the publishing status of the pages
Migrate a planner plan with buckets and tasks to a SharePoint Online list
This script Gets all the flows connected to a SharePoint site
The script copies a library view to library(ies) in destination site
Create teams in an environment to test governance scenarios making over a 1000 teams - this sample script can generate the required teams.
Script which will help to provide bulk access to Power Apps from csv format
This script sample shows how to get SharePoint list items using CAML query with different types of fields
This script sample shows how to export SharePoint list to CSV with attachments
This script sample can be useful to upload dummy documents and versions to SP library by auto incrementing file name
Install and deploy SPFx solution to the SharePoint site
Get users or user profile properties from any SharePoint site collection and we need it in CSV or Excel format
This script sample shows how to associate SharePoint online site with a hub site.
Copy column format from column or web sample and apply to different column
With this sample, you can create a whole bunch of libraries at once.
This script sample shows how to get list fields with some required propertiesand export it to CSV
Perform a search query (such as 'Show me all News Posts in this tenant') and export the results to CSV.
This script creates a report of all flow runs from current day and sends the report as an adaptive card to the provided url
This script sample shows how to update user profile properties.
This script sample shows how to get hub sites information and export it to CSV
List all guests in Microsoft Teams teams in the tenant and exports the results in a CSV.
Export a report on all Whiteboard owners and it's usage.
Remove List designs and corresponding site scripts.
This script allows users to undelete items from recycle bin and restore it in respective document library and list.
Create modern SharePoint pages and adding web parts without using a provisioning engine
The sample script converts all SharePoint online classic publishing pages in a site collection to modern pages in a modern site
This is example for adding a SharePoint Theme as an option for modern sites in the tenant
The scripts get group permission report of site and each list on the site and prints it to console and also sends it as an adaptive card to Teams channel specified by webhook.
The purpose of this script is to exporting Document libraries inc folders and versions for selected Site Collections to a Fileshare/drive
Script to generate Team's full report, gathering all Teams,Channels,Tabs available info.
List all teams and teams members in Microsoft Teams in the tenant and exports the results in a CSV
Conversion of an on-premises 2013 publishing page to the modern experience
Validate all your users against known breaches with the have i been pwned api. That way you can quickly scan if your users are part of any known breaches
This script sample shows how to get all site collections with usage information and Export to CSV.
Provides you with an overview of all orphaned redirect sites and allows you to quickly delete them
This script export a report on all Microsoft Stream videos (complete list and all videos not yet migrated)
Powershell script that reports the status of the latest run of all flows by writing to a M365 list
Delete a large SharePoint library by removing the files and folders before deleting the library
This script sample shows how to get all apps from the app catalog and export it to CSV.
Replace the membership of a user for a selected list of Groups
This script sample shows how to get recycle bin items from SharePoint site and export it to CSV
This script sample shows the basic of using ForEach-Object -Parallel to speed up trivial SharePoint operations across many site collections
Add Large list items to PnP Template using PnP command
This script allow us to clone an existing team (structure and content!) into a new one with changed attributes including content.
The script first exports a selected team template and create a new team based on the template.
This script allow us to collect and export current tenant Teams Templates
Inventories Guest accounts from Azure Active Directory to query all Guest accounts and signInActivity and saves report to SharePoint List
Simple report listing out the language IDs in Markdown
This script sample can be useful to upload dummy documents to SP library by auto incrementing file name
SharePoint Online provides user interface for defining column and view formatting and forms
Gathers all of the teams private channels in your tenant and produces an Excel file
This script allow you to add a new modern calendar view to an existing SharePoint list using the SharePoint REST API
This script sample shows how to export CSV to SharePoint list data
Script that creates and applies custom site design with custom column types
Script that creates multiple libraries by applying custom list template with custom document library, site columns and site content types
This script allow us to force Files tab provision, usefull for migrations or even for your Team's governance toolset..
This script is helpful to identify and inventorize all the Azure AD Applications registered in your tenant
Script that creates and applies custom list template with custom document library, site columns and site content types
This script sample shows how to bulk create lists or libraries using CSV file
This script shows how to export all content from an existing SharePoint site
This script is a good starting point for a setup script to create site with some assets like columns, content types, lists, navigation
Say we have PowerApp that is storing its data in SharePoint lists. We want to make the app multilingual. This sample shows you the process.
This script shows how to import a CSV to an existing SharePoint list without explicitly enumerating all list fields
Create a modern site in another language as the primary language
This script will detect install theme for particular site
This script sample shows how to get permission for site collection with their subwebs and export it to CSV with some required details
Script will set custom regional settings in your sharepoint site
This sample script generates demo events for the SharePoint Events List within a modern site using a CSV file
Get site collections with all the sub-webs
This script sample shows how to copy webparts from one page to another page in the same site collection.
Get/add/update/delete items in large SharePoint list
Script that extract space content type page as template and save it to SharePoint
Script that extracts all the pages in the pages library
The script exports the page from a source site and provisions it to a destination site
A sample of script to provision Azure Function including storage account, resource group, and assign permissions
The sample is a small set of terms to showcase the use case but the requirement was to import 100s of terms with labels into SharePoint Online.
Script to copy custom SPFx web part settings from one page to other pages
The Magic Tooltips module can be installed to help determine the account that is connected to Microsoft 365 or Azure.
Sets the author by line of a modern page
Converts all blog pages in a site
Try a different command, broaden your search, or clear a filter.