How to deploy fonts using Intune

Intune is really a powerful device management tool for any organization. You can setup and configure Intune easily and manage your company devices. There are lots of built-in deployment methods available on Microsoft Intune admin center.

Recently I have written a blog post on How to deploy Powershell scripts using Intune. This also provides great detail and multiple methods on how to check the status of powershell script deployment.

For Deployment of MSI using Intune, there is a Line-of-business app deployment method natively available to deploy any MSI file to users workstations. However, if there is an app / task which you want to perform on end user device, a powershell script or batch file can be deployed as well.

In this blog post, we will be using Win32 app deployment method to deploy fonts to users devices. As there is no easy and native way to deploy fonts using Intune admin center. We will be creating Powershell scripts to Install / Uninstall fonts.

The steps given in this blog post are for Windows devices enrolled and managed using Intune. The devices can be Azure AD joined or Hybrid azure AD joined.

How to Install a Font on a Windows device manually

Before we start the deployment of fonts using Intune, we need to understand what are the steps to install a font on a windows device manually. To install a font on your device, your account should be a member of local administrator on that device. Please follow below steps to Install a font on a windows device.

  1. Download the font from vendors website. For example: Google Fonts.
  2. Right-click the font file (.ttf or .otf) and click on Install for all users.

When you click on Install for all users, it will perform two below two changes:

  1. Font will be copied to C:\Windows\fonts directory.
  2. It will create a registry entry for the font under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts

How to Install Fonts on a Windows Device using Intune

As we now know the steps to Install a font manually on a windows device. We can see how easy it is to Install a font by just following 3 steps. Please also make sure you have appropriate license to Install and use the font.

As Google fonts is open source, you will not need a license to Install and use any fonts downloaded from google fonts. However, you can still go through the FAQs page on their website to know more about google font licensing.

First, we will be creating .IntuneWin file which will be used for deployment of the fonts. Let’s check the steps to create Intunewin file.

STEP 1: Create IntuneWin file for Fonts deployment using Intune

Please find the steps below to create .IntuneWin file. This file will be created using a tool called Microsoft Win32 Content prep tool.

  1. Create an empty folder named DeployFonts or any name you like
  2. Create a subfolder under DeployFonts call it as Fonts
  3. Copy all font files with .ttf or .otf extension to Fonts folder
  4. Create two powershell scripts called InstallFonts.ps1 and Uninstallfonts.ps1 in DeployFonts folder
Prepare your setup files e.g.  fonts and powershell scripts for the deployment
Prepare your setup files e.g. fonts and powershell scripts for the deployment

InstallFonts.ps1

<# 
.SYNOPSIS 
Install Fonts on users devices
 
.DESCRIPTION 
Below script will Install all fonts copied inside Fonts directory to a target device 
 
.NOTES     
        Name       : Font Installation Script
        Author     : Jatin Makhija  
        Version    : 1.0.0  
        DateCreated: 31-Jan-2023
        Blog       : https://cloudinfra.net
         
.LINK 
https://cloudinfra.net 
#>
#Get all fonts from Fonts Folder
$Fonts = Get-ChildItem .\Fonts
$regpath = "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Fonts"
foreach ($Font in $Fonts) {
    $fontbasename = $font.basename
    If ($Font.Extension -eq ".ttf")  {$fontvalue = $Font.Basename + " (TrueType)"}
    elseif($Font.Extension -eq ".otf") {$fontvalue = $Font.Basename + " (OpenType)"}
    else {Write-Host " Font Extenstion not supported " -ForegroundColor blue -backgroundcolor white; break}
    $fontname = $font.name 
    if (Test-path C:\windows\fonts\$fontname)
    {
        Write-Host "$fontname already exists."
    }
    Else
    {
        Write-Host "Installing $fontname"
        #Installing Font
        $null = Copy-Item -Path $Font.fullname -Destination "C:\Windows\Fonts" -Force -EA Stop
    }
    Write-Host "Creating reg keys..."
    #Creating Font Registry Keys
    $null = New-ItemProperty -Name $fontvalue -Path $regpath -PropertyType string -Value $Font.name -Force -EA Stop    
}

UninstallFonts.ps1

<# 
.SYNOPSIS 
Uninstall Fonts from users devices
 
.DESCRIPTION 
Below script will Uninstall all fonts copied inside Fonts directory to a target device 
 
.NOTES     
        Name       : Font Uninstallation Script
        Author     : Jatin Makhija  
        Version    : 1.0.0  
        DateCreated: 31-Jan-2023
        Blog       : https://cloudinfra.net
         
.LINK 
https://cloudinfra.net 
#>
#Get all fonts from Fonts Folder 
$Fonts = Get-ChildItem .\Fonts
$regpath = "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Fonts"
foreach ($Font in $Fonts) {
    $fontname = $font.name
    $fontbasename = $font.basename
    If ($Font.Extension -eq ".ttf")  {$fontvalue = $Font.Basename + " (TrueType)"}
    elseif($Font.Extension -eq ".otf") {$fontvalue = $Font.Basename + " (OpenType)"}
    else {Write-Host " Font Extenstion not supported " -ForegroundColor blue -backgroundcolor white; break} 
    #Remove Font from Windows folder
    Remove-Item C:\windows\fonts\$fontname -force -EA SilentlyContinue
    #Delete corresponding registry keys for the font
    Remove-ItemProperty -Path $regpath -Name $fontvalue -force -EA SilentlyContinue
}
  1. Download Microsoft Win32 Content Prep Tool. Its a zip file therefore extract its contents into a folder.
  1. Create an empty folder for example C:\output or anywhere you like.
  1. Repackage the DeployFonts folder to .intunewin file using IntuneWinAppUtil.exe which can be located in Microsoft Win32 Content Prep Tool.
.\IntuneWinAppUtil.exe -c "C:\DeployFonts\" -s InstallFonts.ps1 -o C:\output
Create Intunewin file for deplyment of fonts using Intune admin center
Create Intunewin file for deployment of fonts using Intune admin center
  1. Once the command completes successfully, you can check c:\output folder where .intunewin file is created. We will use this file later during Intune Windows app (win32) deployment.
Install fonts .intunewin file created successfully
Install fonts .intunewin file created successfully

STEP 2: Deploy Fonts using Intune

Once we have .Intunewin file created successfully. We can use it to deploy fonts on users devices via Microsoft Endpoint manager admin center.

Please follow below steps to create Intune Windows app (Win32) app using .IntuneWin file.

  1. Login on Microsoft Intune admin center
  2. Click on Apps and then click on All Apps.
  3. Click on + Add and Select Windows app (Win32) from the app type.

App Information

Click on Select app package file to browse and select Installfonts.intunewin file and click on OK. On App information tab, provide Information about the Application. Update the NameDescription and Enter the name of the publisher. Click on Next to proceed.

  • Name – Provide a unique name of the application. This name will show up on the Company portal app. For example: Fonts Installation
  • Description – You can use this field to provide your users with Information / Instructions which could help end users while Installing and managing this application from Company portal app.
  • Publisher – This is to Identify the publisher of the application. Publisher also shows up on Company Portal for the app. For example: Microsoft.

Optional fields:

  • App version – Provide App version Information which will show on Company portal app
  • Category – You can choose a category to organize application on the company portal app
  • Show this as a featured app in the Company Portal – If you want to make this as a featured app on Company portal app then select Yes.
  • Information URL – This provides information about the application. You can provide a link which user’s can click on to get more information about this application
  • Privacy URL – Provide a link here which users can click on and find information about Privacy settings and Policies.
  • Developer – Provide a name of the company or a person who has developed this app
  • Owner – Provide a name of the person who manages this app in your organization. This could be IT team name or an Individual who manages licensing etc
  • Notes – Provides additional information about this app which could be helpful for the users
  • Logo – Upload a logo that’s associated with the app. This logo will appear next to the app on Company Portal.
Deploy Fonts using Intune App Information Tab
Provide Information about the App on Intune

Program

Provide the Install command, uninstall commandInstall behavior, Device restart behavior. Click on Next to proceed.

  • Install command:  powershell.exe -Executionpolicy Bypass -File .\Installfonts.ps1
  • Uninstall command: powershell.exe -Executionpolicy Bypass -File .\Uninstallfonts.ps1
  • Install behavior: System
  • Device restart behavior: No specific Action
Provide Install and Uninstall commands for Installation of fonts using Intune
Provide Install and Uninstall commands for Installation of fonts using Intune

Requirements

Provide Operating System Architecture and Minimum operating system information. Click on Next to proceed.

  • Operating System Architecture: 64-bit
  • Minimum operating system: Select according to the operating system version being used in your enviornment. For Example: Windows 10 1607.

Detection Rules

Select Manually configure detection rules and click on +Add to add a detection rule.

  • Rules Format: Select Manually configure detection rules
  • Rule Type: File
  • Path: Provide the location of C:\windows\fonts and the name of the font file to detect.

Create one rule for each font file to detect all fonts under C:\windows\fonts directory. For example:

  • Rule type: File
  • Path: C:\windows\fonts\
  • File or folder: Alata-Regular.ttf
  • Detection Method: File or Folder exists.
Configure detection rules for font's deployment using Intune admin center
Configure detection rules for font’s deployment using Intune admin center

As we had 4 fonts deployed, we created 4 detection rules, one for each font.

Detection rules for all font's we want to detect on target device to confirm deployment
Detection rules for all font’s we want to detect on target device to confirm deployment

Assignments

Create an Azure AD Security group which contains users or devices where this application package needs to be deployed. Please note that if you add users into the list, it will deploy this application on all of the users devices joined to Azure and Enrolled into Intune. If you want to deploy the app to specific devices then you should add devices in the Azure AD security group not users.

Make sure to add it to the Required section which will install the application on users system as soon as possible.

Required: Select the groups for which you want to make this app required. Required apps are installed automatically on enrolled devices. Some platforms may have additional prompts for the end user to acknowledge before app installation begins.

To deploy it on all end user devices, You can click on + Add all devices to target all devices which are enrolled into Intune.

Assign Win32 app deployment to All devices or an Azure AD group containing devices
Assign Win32 app deployment to All devices or an Azure AD group containing devices

Review + Create

Next tab is for Review + Create. Save the application which will start the process of your uploading .intunewin file and also will start the deployment process.

Monitoring the Installation Progress

To check the Installation status of the app, You can follow below steps:

  • From Microsoft Endpoint Manager admin center, Click on Apps on the left hand side.
  • Click on All apps.
  • Search for the app Fonts Installation and click on it.

From the Overview page of the application, you can check the status of Installation and Failures. To find more details on which devices the app is pushed successfully, you can also click on Device Install status or User Install status.

Intune Policy Refresh Cycle

The Device will Sync / Check in and download / install the application on target device. It may take some time for the process to start. Therefore, if you are testing it on a test device, you can force initiate Intune refresh cycle on the device which will speed up the download and installation process. You can also use Powershell to force initiate Intune refresh cycle.

Also, you can restart the device first before force initiating the sync. Manual sync is not mandatory on user’s devices as the device check-in process happens automatically. But if you are testing the application on a test device then this can speed up your testing and can save some time.

End User Experience

On the target devices, there is no user interaction with this package as fonts will be installed on users devices silently.

However, there will be a pop-up notification related to this application if you have “Show all toast notification” setting configured at the time of Intune app assignment. You can disable all toast notifications from Assignments tab under End user notifications setting if you want no notifications or pop-ups related to this deployment.
Show all toast notifications option in App deployment package on Intune admin center
Show all toast notifications option in App deployment package on Intune admin center

Verifying fonts installation from C:\windows\fonts directory

If you can recall, we had deploy below 4 fonts using intune to all windows devices.

  • Alata-Regular.ttf
  • Monda-Bold.ttf
  • Monda-Regular.ttf
  • Paprika-Regular.ttf

Let’s verify if the fonts are now installed on the target devices. To verify the fonts installation, we will need to check the font under C:\windows\fonts directory and check if the corresponding registry entries are created under the reg key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts.

Fonts deployed successfully from Intune admin center to target devices
Fonts deployed successfully from Intune admin center to target devices

Verifying fonts Installation using Registry Editor

You can also verify the installation of fonts from registry editor by following below steps:

  • Press Win + R to open a run box.
  • Type regedit and press enter.
  • Browse to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts and search for the Font names on the right hand side to make sure the entries for the deployed fonts exists.
Verify fonts installation using Windows registry editor
Verify fonts installation using Windows registry editor

Verify the fonts Installation using Microsoft Word

The Installed fonts can be used from any app installed on your windows device. You can verify if the font is showing in these apps by opening any Microsoft Office app for example: Microsoft word and check if the font is installed and ready to use.

Verify fonts installation using Microsoft Word application
Verify fonts installation using Microsoft Word application

Verify the fonts Installation using IntuneManagementExtension Logs file

If you are Interested in further verification of the Installation, For example: When the Intune package was Installed and its status. You can check IntuneManagementExtention.log file located under C:\ProgramData\Microsoft\IntuneManagementExtension\Logs. To get the best readability of the log file. Download CMTrace tool and use it to view this log file.

Search for the app name or powershell script name (Installfonts.ps1) to find the log related to Font Installation app. You can then go through the log file to find more details about the installation. This log file is also helpful for troubleshooting any issues / errors related to app deployment.

Verify the fonts Installation using IntuneManagementExtension Logs file
Verify the fonts Installation using IntuneManagementExtension Logs file

How to Uninstall fonts using Intune

To Uninstall fonts using Intune, we will be using Uninstallfonts.ps1 script. This is already wrapped in the .intunewin file we created earlier and Uninstall command was also specified while creation of Font Installation Intune Win32 app.

Please note you can uninstall the same fonts which have been deployed using Intune as the font files are contained in .intunewin file. As we deployed 4 fonts using our Powershell script and intune Alata-Regular.ttf, Monda-Bold.ttf, Monda-Regular.ttf, Paprika-Regular.ttf, we can uninstall these fonts using below steps:

  • From Microsoft Endpoint Manager admin center, Click on Apps on the left hand side.
  • Click on All apps.
  • Search for the app Fonts Installation app and click on it.
  • Click on Properties under Manage.
  • Scroll down to find Assignments and click on Edit next to it.

To Uninstall these fonts from the devices, simply remove the devices from Required and Include it in Uninstall section. Fonts will be removed from the devices using the Uninstall command we had specified under Program tab.

Uninstall fonts using Intune admin center
Uninstall fonts using Intune admin center

Conclusion

In this blog post, we have seen how to deploy fonts to end user devices using Intune. This post is relevant to windows devices only which are enrolled and managed using Microsoft Intune. You can use the powershell script separately by modifying it according to your own requirement and use it for deployments other than Intune.

There could be a scenario when the license of the fonts you deployed on users devices is expired. If you would use these fonts after the license expiry, you would breach the license agreement. Therefore, in this scenario its best to Uninstall the fonts from users devices using the steps given in this post.

READ NEXT