# Configure CDN
Use PnP Powershell
- Connect
Connect-PnPOnline -Url https://contoso-admin.sharepoint.com -UseWebLogin
- Check if CDN is enabled
Get-PnPTenantCdnEnabled -CdnType Public
- If not enabled, enable without the defaults:
Set-PnPTenantCdnEnabled -CdnType Public -Enable $true -NoDefaultOrigins
- Create a new doclib CDN and add the files.
Add-PnPTenantCdnOrigin -CdnType Public -OriginUrl CDN
- Test if the CDN is available, can take max 15 minutes (will return configuration pending if not yet ready)
Get-PnPTenantCdnOrigin -CdnType Public