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 In-built out of the box deployment methods available on Microsoft Endpoint manager admin center.

For example, 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 from Intune via Microsoft endpoint manager admin center. We will be creating Powershell scripts to Install / Uninstall fonts.

The steps given in this blog post is 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.
  1. Create a subfolder under DeployFonts call it as Fonts.
  1. Copy all font files with .ttf or .otf extension to Fonts folder.
  1. Create two powershell scripts called InstallFonts.ps1 and Uninstallfonts.ps1 in DeployFonts folder.
Create IntuneWin file for Fonts deployment using Intune

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
IntuneWin file creation for deploying fonts on windows using Intune
  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.
InstallFonts.intunewin file

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 Endpoint Manager 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 Tab

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: Fonts Installation
  • Description: Keep Default or to change click Edit Description.
  • Publisher: Microsoft
Deploy Fonts using Intune App Information Tab

Program Tab

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
Deploy Fonts using Intune Program Tab

Requirements Tab

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.
Font deployment intune detection rule

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

Font deployment windows intune detection rule

Assignments Tab

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.

Deploy Fonts using Intune Assignments tab

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 / intstall 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.

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 Intune App deployment

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.

Verifying fonts installation from C:\windows\fonts directory

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.
Verifying fonts Installation using 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 the fonts Installation using Microsoft Word

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

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.

How to Uninstall fonts using Intune

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.

Leave a Comment