Check all SharePoint sites collections with App Catalog active

Image by TeroVesalainen from Pixabay

If you have SharePoint custom solutions, you can have then installed globally, on your Tenant App Catalog or on the site collection – Site App Catalog. Each time that you create the Site App Catalog, you will see that on the site collection but if you do this process for multiple sites, you may forget each one has that feature active. So today, we’ll use a PowerShell Command to extract this information and also provide the URL that you can access to verify the information on this hidden list.

If you access the site collection, you’ll see on the Site Contents a special list with the name Apps for SharePoint, but create a report which site has this feature will take a while. So on your Tenant App Catalog, you have a hidden list that stores this information, to access it via URL please follow the following syntax.

tenant.sharepoint.com/sites/AppCatalogUrl/Lists/SiteCollectionAppCatalogs/AllItems.aspx

If you intend to have a PNP PowerShell report of this list, you can run the below code, you just need to correct the $loginUrl your own domain.

$loginUrl = "https://contoso.sharepoint.com/"
Connect-PnPOnline -Url $loginUrl -UseWebLogin
$appCatalog = Get-PnPTenantAppCatalogUrl
Connect-PnPOnline -Url $appCatalog -UseWebLogin

$items = Get-PnPListItem -List "Site Collection App Catalogs"
$count = 1
foreach($item in $items){
	Write-host $count "-" $item.FieldValues.Item("SiteCollectionUrl")
	$count = $count + 1 
}

Conclusion

With this, we can then identify which solutions are deployed on our SharePoint Online. You can then get a full report if you wish will a few enhancements on the PowerShell. If you intend to know how you can create a site App Catalog visit the following link.

4 Comments

  1. Hi David,

    Great idea indeed.
    I found a few issues with using the “Site Collection App Catalogs” list.
    – It contains duplicates. If you install and uninstall the site app catalog a few times.
    – It contains data for app catalogs being uninstalled and also sites being deleted. So it does not do any cleanup if a site is being deleted.

    Another possible solution to get around these issues is to use SharePoint search with the folowing KQL query:
    “contentclass:STS_List_336 OR contentclass:STS_List_330”

    Where …
    – 336 is the site collection app catalog base template
    – 330 is the tenant app catalog base template.

    You can imagine that this is also not perfect because if I recently provisioned new site app catalog it might not be crawled yet, but at least it removes the duplicates and the already deleted app catalogs.

    I will try to create an Office 365 CLI script and mention you and your blog as an inspiration. I hope you are ok with this.

    November 11, 2019
    Reply
    • David Ramalho said:

      Hi Velin,

      Thanks for the detailed description of the issues found with the Site Collection App Catalogs list, I was not aware. I’m ok with you sharing my blog post and let me know if I can help. Once you do that, I’ll update the blog post with that information.

      My best,
      David Ramalho

      November 11, 2019
      Reply

Leave a Reply

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