Skip to main content

Fonts play an essential role in creating visually appealing and engaging content. However, managing fonts across multiple devices can be a challenging task for IT administrators. This is where Microsoft Intune comes in handy. Microsoft Intune is a cloud-based service that helps IT professionals manage and secure company devices. One of its features is the ability to deploy fonts to devices managed by Intune, making it easier for organizations to ensure consistency in branding and communication across all devices. In this blog post, we will explore how to deploy fonts using Microsoft Intune, and how this feature can benefit your organization.

What are we going to set up?

In the first step, we will create an IntuneWin file using the Fonts files and two PowerShell scripts. In the second step, we will upload this file to Intune and configure the parameters. This allows us to achieve a smooth installation on the clients.

Create IntuneWin file

To deploy Fonts with Intune we first need to create the IntuneWin file. Follow these steps:

  • Create a new folder called Output on C:
  • Create a new folder called DeployFonts on C:
  • In the Deployfonts folder create another called Fonts
  • Copy all your Fonts into the C:\DeployFonts\Fonts folder
  • We need to create two Powershell scripts
  • Copy the bellow and name it 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     : whackasstech.com
        Version    : 1.0.0  
        DateCreated: 13-Apr-2023
        Blog       : https://whackasstech.com
         
#>

#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    
}
  • Create a second Powershell script. Copy the bellow and name it 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
}
  • Download the official Microsoft Intune Win App Tool
GitHub Intune Win App Tool
  • Open the Intune Win App Tool.

Important: You need to open the Tool with Administrator right. Otherwise there will be an error. 

In the Intune Win App Tool define the following:

  • Please specify the source folder: C:\DeployFonts
  • Please specify the setup file: InstallFonts.ps1
  • Please specify the output folder: C:\output
  • Do you want to specify catalog folder: N

In your Output Folder, there should be a new file called InstallFonts.intunewin

We need this file in Step 2

Import and deploy with Intune

  • Go to endpoint.microsoft.com
  • Click on Apps
  • Click on Windows
  • Click on Add
  • Chose App type Windows app (win32)
  • Click on Select
  • Click on Select app package file
  • Upload your IntuneWin file which is located in C:\output
  • Click on OK
  • Click on Next
  • Here you can change the Settings. I leave it as it is. Dont forget to enter a Publisher
  • Click on Next

Enter the following Commands:

  • 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
  • Click on Next

On the Requirements tab enter:

  • Operating system architecture: 64-bit
  • Minimum operating system: Windows 10 1607
  • Click on Next

For the Detection rule it can be a little bit tricky. Some fonts will be installed into the C:\windows\fonts folder but other will only be visible in the registry. Because of that we first need to validate where the font will be installed.

  • Install the font on your own computer
  • Check in C:\windows\fonts if the font is in that folder.

If your font is visible in the C:\windows\fonts folder you can use the detection rule with File. If not use the Detection Rule with Registry.

Detection Rule with File

Only use this detection rule when the font is installed in C:\windows\fonts folder.

  • Rules format: Manually configure detection rules
  • Click on Add
  • Rule type: File
  • Path: C:\windows\fonts
  • File or Folder: [Enter here the name of the font File] In my case I enter akashi.ttf. If you have multiple Fonts, create for each Font a seperate Rule
  • Detection method: File or folder exists
  • Associated with a 32-bit app on 64-bit clients: No
  • Click on Ok and on Next

Detection Rule with Registry

Use this detection rule when the font is NOT installed in C:\windows\fonts folder. We first need to get some information from the Registry.

  • Open the Registry
  • Navigate to Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts

Search for your font. We need to copy the Name of the font we want to deploy. For demonstration I will pick Arial Italic (TrueType)

  • Rules format: Manually configure detection rules
  • Click on Add
  • Rule type: Registry
  • Key path: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts
  • Value name: [Enter here the name of the font] In my case I enter Arial Italic (TrueType). If you have multiple Fonts, create for each Font a seperate Rule
  • Detection method: Value exists
  • Associated with a 32-bit app on 64-bit clients: No
  • Click on Ok and on Next
  • In the Dependencies tab, enter the scope when applicable. Click on Next.
  • In the Supersedence tab, enter the scope when applicable. Click on Next.
  • On the Assignments tab assign the Policy to a Group or to All User
  • Click on Next
  • And Review + Create the Policy

Congratulations! You have successfully deployed the policy.

Conclusion

You learned how to deploy Fonts with Microsoft Intune. We used the Intune Win App to install the fonts to the local machines.

Did you enjoy this article? Dont forget to follow us and share this article. You may also like the the following articles.

Max

5 Comments

  • Anonymous says:

    Thank you so much!

  • Jay says:

    Thanks but it fails for me with error 0x80070001 in intune

    • Max says:

      Was the font installed despite the error code? Usually the detection rule is not quite correct.
      Also make sure that your font name has no spaces. This also gave me an error once.
      If you still have errors, you are welcome to send me an email with screenshots info@whackasstech.com. Then I can have a look at it.

  • James says:

    Hi Max, thanks for the write up! I ran into an error message which was a detection error “0x87D1041C”. I was using c:\windows\font File detection method. Changed rule to Registry using “Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts”, Value name: “Your Font Name (TrueType)” and Value exists with success. Hope this helps some people, thank again.

    • Max says:

      Hey James, Thank you for your comment. I appreciate it very much. As I have received several comments I have adjusted this in the blog post. Thanks again, Regards Max

Leave a Reply