How to configure Custom Office Templates using Intune

Most organizations use custom office templates and traditionally GPO would be used to configure them. However, things are evolving and traditional methods may not get you the desired results anymore. One will need a more robust method which allows you to manage the templates centrally and update the same on end user devices quickly and efficiently. I recently had a similar requirement and decided to blog about the configuration I put in place.

Things that you will need –

  1. Devices enrolled into Intune.
  2. Azure Blob Storage.
  3. Onedrive for Business installed and configured for Known folder Move (KFM)

Step 1 –

Upload the templates in the Blob storage and set the relevant permissions. You can set it to Private to make it restrictive, but I am choosing to make it Anonymous for the Container at a granular level. 

Step 2 –

Create the Admin template policy to configure the custom templates location as shown below –

  • Sign-in to the https://endpoint.microsoft.com
  • Browse to Devices – Windows – Configuration Profiles
  • Click Create Profile
  • Select Platform as Windows 10 and later
  • Select Profile as Administrative Templates
  • Provide a Name and hit next.
  • Under Configuration Settings- All Stettings, search for Template
  • Configure the following settings:

Personal templates path for PowerPoint%USERPROFILE%\Documents\Custom Office Templates

Personal templates path for Word%USERPROFILE%\Documents\Custom Office Templates

Show custom templates tab by default in PowerPoint on the Office Start screen and in File | NewEnabled

Show custom templates tab by default in Word on the Office Start screen and in File | NewEnabled

  • Commit the settings and assign to a device-based group.

Step 3 –

Create the Admin template policy to configure the OneDrive settings as shown below –

  • Sign-in to the https://endpoint.microsoft.com
  • Browse to Devices – Windows – Configuration Profiles
  • Click Create Profile
  • Select Platform as Windows 10 and later
  • Select Profile as Administrative Templates
  • Provide a Name and hit next.
  • Under Configuration Settings- All Stettings, search for the following settings:

Silently sign in users to the OneDrive sync app with their Windows credentials - Enabled

Silently move Windows known folders to OneDrive - Enabled  & Don't show notifications (Provide your TenantId)

Prevent users from syncing personal OneDrive accounts - Enabled

Limit the sync app upload rate to a percentage of throughput - Enabled (70 for Bandwidth)

Use OneDrive Files On-Demand - Enabled

  •  Commit the settings and assign to a user-based group.

Step 4 –

I am using a PowerShell script to download the contents from the Blob Storage and placing them under %USERPROFILE%\Documents\Custom Office Templates. To get the Url of each blob file, just right click on the file and copy the URL. The Power Shell code is as follows –

#Capture the %Userprofile%\Documents folder path

########################################################################################

$path = "$($env:USERPROFILE)\Documents" + "\Custom Office Templates"

 If(!(test-path $path))

{

      New-Item -ItemType Directory -Force -Path $path

}

########################################################################################

#Download the templates

########################################################################################

$url1 = "https://xxxx.blob.core.windows.net/xxxxofficetemplates/Normal.dotm"

$url2 = "https://xxxx.blob.core.windows.net/xxxxofficetemplates/NormalEmail.dotm"

$url3 = "https://xxxx.blob.core.windows.net/xxxxofficetemplates/xxxx_TEMPLATE.potx"

$url4 = "https:// xxxx.blob.core.windows.net/xxxxofficetemplates/xxxx-Letterhead-noaddress.dotx"

$url5 = "https://xxxx.blob.core.windows.net/xxxxofficetemplates/xxxx-Letterhead.dotx"

$url6 = "https:// xxxx.blob.core.windows.net/xxxxofficetemplates/xxxx-PPT-Template.potx"

$url7 = "https://xxxx.blob.core.windows.net/xxxxofficetemplates/xxxx-PPT-Template.pptx"

$url8 = "https://xxxx.blob.core.windows.net/xxxxofficetemplates/xxxx-Widescreen-PPT-Template_v3.potx"

$output1 = $path + "\Normal.dotm"

$output2 = $path + "\NormalEmail.dotm"

$output3 = $path + "\xxxx _TEMPLATE.potx"

$output4 = $path + "\xxxx-Letterhead-noaddress.dotx"

$output5 = $path + "\xxxx-Letterhead.dotx"

$output6 = $path + "\xxxx-PPT-Template.potx"

$output7 = $path + "\xxxx-PPT-Template.pptx"

$output8 = $path + "\xxxx-Widescreen-PPT-Template_v3.potx"

Start-BitsTransfer -Source $url1 -Destination $output1

Start-BitsTransfer -Source $url2 -Destination $output2

Start-BitsTransfer -Source $url3 -Destination $output3

Start-BitsTransfer -Source $url4 -Destination $output4

Start-BitsTransfer -Source $url5 -Destination $output5

Start-BitsTransfer -Source $url6 -Destination $output6

Start-BitsTransfer -Source $url7 -Destination $output7

Start-BitsTransfer -Source $url8 -Destination $output8

########################################################################################

Step 5 –

Import the PowerShell script from above into Intune.

  • Sign-in to the https://endpoint.microsoft.com
  • Browse to Devices – Windows – PowerShell Scripts
  • Click on Add
  • Give a Name
  • Select the script
  • Set Run this script using the logged on credentials as Yes
  • Set Enforce script signature check to No
  • Set Run script in 64 bit PowerShell Host as Yes
  • Commit and deploy to a user-based group.

End Result –

The PowerShell script will download the templates from the Blob storage and place them in the %USERPROFILE%\Documents\Custom Office Templates at first run. The templates will be copied under C:\Users\<USERPROFILE>\Documents\Custom Office Templates. After the Known Folder Move policy runs for OneDrive, the templates will then be moved to user’s OneDrive for Business Cloud storage. The same will then reflect under C:\Users\<USERPROFILE>\OneDrive – <Tenant name>\Documents\Custom Office Templates).

Once done, the templates will show up like this –

 


Happy days..

Comments

  1. Is it possible to not use a Blob storage and use a networkshare instead to copy the templates to user profile and sync with O4B ?

    ReplyDelete
    Replies
    1. Absolutely. Just modify the script to point the source to copy from the network share.

      Delete
    2. is there a way to unmount the oneDrive folder in file explorer using powershell Script ?

      Delete
    3. Hi Rahul, how would you modify the script to use a local UNC path rather than a blob storage address?

      Delete
  2. Nice post! This is a very nice blog that I will definitively come beck to moretimes this year! thanks for the informative post. Download Office Tab Enterprise

    ReplyDelete
  3. Hello rahul, I have followed step by step. I do see the 'Personal' tab as well, but no templates have come through yet.

    I can see the 'Custom Templates' folder created as well , but no luck.

    ReplyDelete
    Replies
    1. Are the template files present in the destination folder?

      Delete

Post a Comment

Popular posts from this blog

How to force escrowing of BitLocker recovery keys using Intune

Intune: Configure Printers for Non-Administrative Users

Prevent users from running certain programs or applications on Windows endpoints using Intune