June 6, 2020

196 words 1 min read

Find all pages utilizing the Microsoft 365 Learning Pathways web part

Find all pages utilizing the Microsoft 365 Learning Pathways web part

An interesting thread was initiated by Loryan Strant on Twitter.

The solution

That sparked an idea, and finally, a potentially very easy solution! I Think the main issue is to find where a web part is being used to be able to contact site owners to manage change management (when a new version of a web part is available), allow a better understand of the utilized web parts, etc.

Mikael Svenson already wrote a great article on how to Locate a Locate pages where a particular web part is being using on modern SharePoint sites. I used a similar approach with the component id of the Microsoft 365 Learning Pathways.

The script

# Connecting to your tenant
Connect-PnPOnline -Url https://tenant.sharepoint.com

# Getting the list of pages utilizing the Learning Pathways web part
Submit-PnPSearchQuery -Query "FileExtension:aspx 141d4ab7-b6ca-4bf4-ac59-25b7bf93642d" -All -RelevantResults | Select-Object OriginalPath

And the result!

Hope it’s useful!

comments powered by Disqus