Find all pages utilizing the Microsoft 365 Learning Pathways web part
An interesting thread was initiated by Loryan Strant on Twitter.
Can any #SharePoint folks out there think of a way to find each site that a particular app is installed?
— Loryan Strant (@LoryanStrant) June 5, 2020
This would help for orgs that install the M365 Learning Pathways app into multiple sites. Any ideas@sympmarc @jfj1997 @mkashman @Karuana @mrackley @AlistairPugin?
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!