Saturday, November 3, 2018

Enable Office 365 CDN (Content Delivery Network)

I recently had a user complain that their Picture Library Slideshow Web Part stopped working in the SharePoint Online instance. After some research, I stumbled across a MS Support article that Non-CDN enabled picture libraries would no longer switch pictures automatically.

You can find more information on CDN here.

After looking into information on public and private CDN, we decided to go with the private CDN option as our site hosting the picture library is a private SharePoint site.

Solution: While the solution to activate and configure the CDN can be easily found on MS Support site, below are the steps for your reference.

In SharePoint Online Management Shell:

Step 1: Activating CDN in your SharePoint Online Tenant.
  1. Connect-SPOService 
    1. Type tenant admin URL – https://www.<tenant-url>-admin.sharepoint.com
    2. Enter administration credentials
  2. Get-SPOTenantCdnEnabled
    1. Type “Private” and press Enter (Type Public if you want to enable public CDN)
  3. Set-SPOTenantCdnEnabled -CdnType private -Enable $true (Type Public if you want to enable public CDN)
    1. Press Y to confirm
Step 2: Configuring the CDN Origin
  1. Add-SPOTenantCdnOrigin -CdnType private -OriginUrl */<picture-library-url> (Type Public if you want to enable public CDN)
    1. Press Y to confirm
    2. Wait 15 minutes for the configuration to take effect.
Step 3: Configuring the CDN Origin Policy
  1. Set-SPOTenantCdnPolicy -CdnType Private -PolicyType IncludeFileExtensions -PolicyValue "gif,ico,jpeg,jpg,js,png" (Type Public if you want to enable public CDN)
Step 4: Deleting the default origins (Optional. Use only if you intend to delete the default origins paths)
  1.  Get-SPOTenantCdnOrigins 
    1. Type “Private” and press Enter (Type Public if you want to enable public CDN origin). Determine the origins you intend to delete
  2. Remove-SPOTenantCdnOrigin -CdnType Private -OriginUrl */<origin-path>
Please report any issues in the comments section.


Friday, December 8, 2017

Error creating site with Custom Site Template in Office 365

I recently ran into an issue in Office 365 SharePoint where creating a new site using Custom Site Template would result in an error below.

GlobalHold                      Feature  Site collection  2a6bf8e8-10b5-42f2-9d3e-267dfb0de8d4  Not activated
MobileExcelWebAccess  Feature  Site collection  e995e28b-9ba8-4668-9933-cf5c146d7a9f  Not activated

The new site template has both these site collection features enabled. However, the target site collection/site does not have these features activated.

For my use case, I didn't need these features activated in the target site so they had to be deactivated in the template itself. To disable these feature in the template please follow the instructions provided by Microsoft support below.

Solution:

  1. Providing you .dll and .ps1 file. 
  2. Create folder on your local machine and save these two files. Ensure to unblock the file by going to properties and select unblock.
  3. Under this folder save site template (.wsp file).  Ensure to unblock the file by going to properties and select unblock.
  4. Then run .ps1 file in PowerShell using the following command. See Screenshot.

    .\office365stupdater.ps1 '.\<your-template>.wsp'

    Replace <your-template> with the name of your .wsp file.
  5. It will complete the extracting and updating.
  6. Then on the same folder you can find updated solution file in the same folder (named Updated-<your-template>.wsp)
  7. Upload the updated .wsp file to the target site collection and activate the solution. 
  8. Create a new site using the template and you should no longer receive the error.

Please report any issues in the comments section.