Get all SharePoint Embedded containers with PowerShell (paging included)

As known and documented by Microsoft, the PowerShell command Get-SPOContainer returns the first 200 SharePoint Embedded (SPE) containers. If you have more containers in your tenant, you must loop through all pages until you have collected all containers. Unfortunately, the equivalent command Get-PnPContainer does not yet support all SPE container properties.

It’s annoying that the SharePoint PowerShell command includes no -All parameter. So, I wrote a PowerShell script to collect all containers for either Microsoft Loop, Microsoft Designer, or both. The script loops through all pages and returns the containers from your tenant. Optionally, the script returns the container details (properties).

  • Microsoft has documented the application IDs for these two container types. The script is designed with flexibility in mind, making it easy to add support for additional application IDs as they become available or if you prepared your own SPE containers.
  • For my scenario, it’s implemented as a standalone script. It can be easily refactored into a function for reuse in other scripts or inclusion in your own PowerShell module.


Requirements
  • Your account must be either a Global Reader or a SharePoint Embedded administrator.
  • You need the SharePoint Online PowerShell module.
  • You’ll need to run the script using PowerShell 5 since the SharePoint Online PowerShell module still lacks PowerShell 7 compatibility.
    Thanks to the SharePoint Online PowerShell development team for their continued commitment to not supporting PowerShell 7.
  • You need my script Get-TAAllSPEContainers, which you can download from my GitHub repository.


Get the SharePoint Embedded containers

First, connect to your SharePoint tenant as a Global Reader or SharePoint Embedded administrator.

PowerShell
# You must use PowerShell 5
Import-Module Microsoft.Online.SharePoint.PowerShell
Connect-SPOService -Url "https://<Tenant>-admin.sharepoint.com 


Second, run the script.

PowerShell
# Unless specified otherwise, the script collects containers for Microsoft Loop and Microsoft Designer by default.
$AllSPEContainers = .\Get-TAAllSPEContainers.ps1 # OR

$AllLoopContainers = .\Get-TAAllSPEContainers.ps1 -OwningApplication MicrosoftLoop # OR

$AllDesignerContainers = .\Get-TAAllSPEContainers.ps1 -OwningApplication MicrosoftDesigner # OR

# Include detailed properties for each container.
# Depending on the number of containers, this may take a while.
$AllLoopContainers = .\Get-TAAllSPEContainers.ps1 -OwningApplication MicrosoftLoop -IncludeDetails


Third, you get the results.

PowerShell

The difference between basic and detailed results (parameter -IncludeDetails).

Basic results
It’s just the container, with the container ID, creation date, the PrincipalOwner (for newer container types), and other information. The owner is missing in older SPE container types (like the Ideas container). You get the results quickly.

Basic container information
Basic container information

Detailed results
The script collects the container identities, including all properties provided by SharePoint. Depending on the number of SPE containers, the collection may take a while.

Detailed container information
Detailed container information
Share
Avatar photo

Tobias Asböck

Tobias is a Senior System Engineer with around ten years of professional experience with Microsoft 365 products such as SharePoint Online, SharePoint Premium, OneDrive for Business, Teams Collaboration, Entra ID, Information Protection, Universal Print, and Microsoft 365 Licensing. He also has 15+ years of experience planning, administering, and operating SharePoint Server environments. Tobias is a PowerShell Scripter with certifications for Microsoft 365 products. In his spare time, Tobias is busy with updates in the Microsoft 365 world or on the road with his road bike and other sports activities. If you have additional questions, please contact me via LinkedIn or [email protected].

Leave a Reply

Your email address will not be published. Required fields are marked *