Create Private / Public CDN in SharePoint Online
Here are some command which can help you to create your own CDN :
# Connect to your tenant
Connect-SPOService -Url https://mytenant-admin.sharepoint.com
# Check the current status of CDN capability - by default disabled
Get-SPOTenantCdnEnabled -CdnType Public
Get-SPOTenantCdnEnabled -CdnType Private
# Enable CDN using default settings - -NoDefaultOrigins as optional parameter
Set-SPOTenantCdnEnabled -CdnType Public -NoDefaultOrigins
Set-SPOTenantCdnEnabled -CdnType Private -NoDefaultOrigins
# Get CDN policies
Get-SPOTenantCdnPolicies -CdnType Public
Get-SPOTenantCdnPolicies -CdnType Private
# Add CDN origin
Add-SPOTenantCdnOrigin -CdnType Public -OriginUrl sites/cdn/cdn
Add-SPOTenantCdnOrigin -CdnType Private -OriginUrl sites/pub35/assets
# Get CDN origin
Get-SPOTenantCdnOrigins -CdnType Public
Get-SPOTenantCdnOrigins -CdnType Private
# Public CDN Url, when configured
https://publiccdn.sharepointonline.com/<tenant host name>/sites/sites/library
# Remove CDN origin
Remove-SPOTenantCdnOrigin -CdnType Public -OriginUrl sites/cdn/cdn
Remove-SPOTenantCdnOrigin -CdnType Private -OriginUrl sites/pub35/assets
# Disable CDN using default settings
Set-SPOTenantCdnEnabled -CdnType Public -Enable $false
Set-SPOTenantCdnEnabled -CdnType Private -Enable $false
# Connect to your tenant
Connect-SPOService -Url https://mytenant-admin.sharepoint.com
# Check the current status of CDN capability - by default disabled
Get-SPOTenantCdnEnabled -CdnType Public
Get-SPOTenantCdnEnabled -CdnType Private
# Enable CDN using default settings - -NoDefaultOrigins as optional parameter
Set-SPOTenantCdnEnabled -CdnType Public -NoDefaultOrigins
Set-SPOTenantCdnEnabled -CdnType Private -NoDefaultOrigins
# Get CDN policies
Get-SPOTenantCdnPolicies -CdnType Public
Get-SPOTenantCdnPolicies -CdnType Private
# Add CDN origin
Add-SPOTenantCdnOrigin -CdnType Public -OriginUrl sites/cdn/cdn
Add-SPOTenantCdnOrigin -CdnType Private -OriginUrl sites/pub35/assets
# Get CDN origin
Get-SPOTenantCdnOrigins -CdnType Public
Get-SPOTenantCdnOrigins -CdnType Private
# Public CDN Url, when configured
https://publiccdn.sharepointonline.com/<tenant host name>/sites/sites/library
# Remove CDN origin
Remove-SPOTenantCdnOrigin -CdnType Public -OriginUrl sites/cdn/cdn
Remove-SPOTenantCdnOrigin -CdnType Private -OriginUrl sites/pub35/assets
# Disable CDN using default settings
Set-SPOTenantCdnEnabled -CdnType Public -Enable $false
Set-SPOTenantCdnEnabled -CdnType Private -Enable $false
- SharePoint Online Management Shell (Download the latest version from here.)
- Administrator rights
Comments