Commands › SharePoint Online

Set-SPOTenantCdnEnabled

SharePoint Online Microsoft.Online.SharePoint.PowerShell Set-*

Enables or disables Public content delivery network (CDN) or Private CDN on the tenant level. Requires Tenant administrator permissions.

Quick start script

# Set-SPOTenantCdnEnabled — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-SPOService -Url https://$org-admin.sharepoint.com

# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-SPOTenantCdnEnabled
$before | Format-List

# 3. Make the change (dry run first)
Set-SPOTenantCdnEnabled  -WhatIf
Set-SPOTenantCdnEnabled

# 4. Verify and diff
$after = Get-SPOTenantCdnEnabled
Compare-Object ($before | Out-String) ($after | Out-String)

Syntax

Set-SPOTenantCdnEnabled [-Enable <Boolean>] [-CdnType <SPOTenantCdnTypeClient>] [-NoDefaultOrigins] [-WhatIf]
 [-Confirm] [<CommonParameters>]

Parameters (5)

ParameterTypeRequiredWhat it controls
-CdnType SPOTenantCdnTypeClient Specifies the CDN type. The valid values are: public or private.
-Enable Boolean Specifies if the CDN is enabled.
-NoDefaultOrigins SwitchParameter PARAMVALUE: SwitchParameter
-Confirm SwitchParameter Prompts you for confirmation before running the cmdlet.
-WhatIf SwitchParameter Shows what would happen if the cmdlet runs. The cmdlet is not run.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.