Manage Tenant Wide Extensions using Office 365 CLI

Sample Office 365 CLI scripts to manage the Tenant Wide Extensions in a Tenant.

App Catalog Site Collection is used to manage the SharePoint add-ins and SharePoint Framework web parts, Extensions in the tenant. If the SharePoint Framework Extensions are configured to deploy tenant wide, those activation’s are managed in a hidden list called Tenant Wide Extensions.

List all Tenant Wide Extensions

The below Office 365 CLI example script used to fetch and return all the Tenant Wide Extensions are added in the Tenant.

$listname = "Tenant Wide Extensions" 
$fields = "Id, Title, TenantWideExtensionDisabled, TenantWideExtensionLocation"

o365 login
$appcatalogurl = o365 spo tenant appcatalogurl get
o365 spo listitem list --t $listname -u $appcatalogurl -f $fields

The Tenant Wide Extensions list contains the following fields, we can also add these in above script to fetch more information of the deployed extensions,

Column Internal Name Description
Title Title Title of the entry. It can be a descriptive entry for registration.
Component Id TenantWideExtensionComponentId The manifest ID of the component. It has to be in GUID format and the component must exist in the App Catalog.
Component Properties TenantWideExtensionComponentProperties Optional component properties.
Web Template TenantWideExtensionWebTemplate It can be used to target extension only to a specific web template.
List template TenantWideExtensionListTemplate List type as a number.
Location TenantWideExtensionLocation Location of the entry. There are different support locations for application customizers and ListView Command Sets.
Sequence TenantWideExtensionSequence The sequence of the entry in rendering.
Host Properties TenantWideExtensionHostProperties Additional server-side configuration, like pre-allocated height for placeholders.
Disabled TenantWideExtensionDisabled Is the entry enabled or disabled?

 

List disabled Tenant Wide Extensions

The below sample script helps to returns the disabled Tenant wide extension from the tenant.

$listname = "Tenant Wide Extensions"
$fields = "Id, Title, TenantWideExtensionDisabled, TenantWideExtensionLocation"

o365 login
$appcatalogurl = o365 spo tenant appcatalogurl get
o365 spo listitem list --t $listname -u $appcatalogurl -f $fields -l  TenantWideExtensionDisabled eq 1"

To get enabled extensions, apply the filter as “TenantWideExtensionDisabled eq 0

Disable the Tenant Wide extension

Disabling the Extensions will deactivate the extensions across the tenant, and we can’t use this extension in any site collection. The below script helps to disable the activated Tenant Wide Extension across the tenant based on the id

$listname = "Tenant Wide Extensions"

o365 login
$appcatalogurl = o365 spo tenant appcatalogurl get
o365 spo listitem set -t $listname -i 1 -u $appcatalogurl --TenantWideExtensionDisabled "true"

Enable the Tenant Wide Extension

The below example script helps to enable the disabled extension by applying the false value to the TenantWideExtensionDisabled column.

$listname = "Tenant Wide Extensions"

o365 login
$appcatalogurl = o365 spo tenant appcatalogurl get
o365 spo listitem set -t $listname -i 1 -u $appcatalogurl --TenantWideExtensionDisabled "false"
Shantha Kumar
Shantha Kumar
Articles: 278