Disable specified Tenant-wide Extension
Summary
Tenant Wide Extensions list from the App Catalog helps to manage the activation / deactivation of the tenant wide extensions. The below sample script helps to disable the specified tenant wide extension based on the id parameter.
Note
TenantWideExtensionDisabled column denotes the extension is enabled or disabled.
$extensionName = Read-Host "Enter the Extension Name"
$listName = "Tenant Wide Extensions"
$appCatalogUrl = m365 spo tenant appcatalogurl get
$filterQuery = "Title eq '" + $extensionName + "'"
$appItems = m365 spo listitem list --title $listName --webUrl $appCatalogUrl --fields "Id,Title" --filter $filterQuery --output json
$extItems = $appItems.Replace("Id", "ExtId") | ConvertFrom-JSON
if ($extItems.count -gt 0) {
m365 spo listitem set --listTitle $listName --id $extItems.ExtId --webUrl $appCatalogUrl --TenantWideExtensionDisabled "true" >$null 2>&1
Write-Host("Extension disabled.");
}
else {
Write-Host("No extensions found with the name '" + $extensionName + "'.");
}
Check out the CLI for Microsoft 365 to learn more at: https://aka.ms/cli-m365
Source Credit
Sample first appeared on Disable specified Tenant-wide Extension | CLI for Microsoft 365
Contributors
Author(s) |
---|
Shantha Kumar T |
Disclaimer
THESE SAMPLES ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.