How to Deploy Fonts with MEMCM
I have been releasing a lot of “Quick Tips” on Twitter recently. This post falls into that category. It isn’t necessarily a deep dive but something that has been requested a few times. In this post I will show you how to deploy SYSTEM Fonts using MEMCM (ConfigMgr)
1 . Background ⏏
From time to time we may be asked to deploy Fonts to devices. This can be done manually via the Fonts Control Panel applet Start > Settings > Personalization > Fonts

or downloaded by the user from the Microsoft Store. But we like automation and we like MEMCM, so lets create a script and deploy the Font using an application.
2 . Prerequisites ⏏
The Font will need to be of file type:-
- TTF
- OTF
- FON
- FNT
If you have downloaded a Font from one of the many free sites, make sure you have permissions to distribute it in your organization. Not all Fonts are free for commercial use.
In this example, we are only installing a single Font - Switzerland.ttf
3 . Scripts ⏏
We will be using PowerShell to install the Font and will require two scripts. One for installation and another for uninstallation.
Script 1: Install a Font https://github.com/byteben/Windows-10/blob/master/Install_Font.ps1
<#
===========================================================================
Created on: 04/07/2020 13:06
Created by: Ben Whitmore
Organization: -
Filename: Install_Font.ps1
===========================================================================
Version:
1.0
#>
#Set Current Directory
$ScriptPath = $MyInvocation.MyCommand.Path
$CurrentDir = Split-Path $ScriptPath
#Set Font Reg Key Path
$FontRegPath = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts"
#Grab the Font from the Current Directory
foreach ($Font in $(Get-ChildItem -Path $CurrentDir -Include *.ttf, *.otf, *.fon, *.fnt -Recurse)) {
#Copy Font to the Windows Font Directory
Copy-Item $Font "C:\Windows\Fonts" -Force
#Set the Registry Key to indicate the Font has been installed
New-ItemProperty -Path $FontRegPath -Name $Font.Name -Value $Font.Name -PropertyType String | Out-Null
}Script 2: Uninstall a Font https://github.com/byteben/Windows-10/blob/master/Uninstall_Font.ps1
<#
===========================================================================
Created on: 04/07/2020 13:06
Created by: Ben Whitmore
Organization: -
Filename: Uninstall_Font.ps1
===========================================================================
Version:
1.0
#>
#Set Current Directory
$ScriptPath = $MyInvocation.MyCommand.Path
$CurrentDir = Split-Path $ScriptPath
#Set Font Reg Key Path
$FontRegPath = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts"
#Grab the Font from the Current Directory
foreach ($File in $(Get-ChildItem -Path $CurrentDir -Include *.ttf, *.otf, *.fon, *.fnt -Recurse)) {
#Remove the Font from the Windows Font Directory
Remove-Item (Join-Path "C:\Windows\Fonts" $File.Name) -Force | Out-Null
#Remove the corresponding Registry Key
Remove-ItemProperty -Path $FontRegPath -Name $File.Name | Out-Null
}4 . MEMCM Application ⏏
1 . Put the following files into your source content directory.
Install_Font.ps1
Uninstall_Font.ps1
Switzerland.ttf

2 . Navigate to Software Library > Application Management > Applications > Create Application

3 . Select Manually specify the application information and click Next

4 . Fill in the Application information and click Next

5 . Specify how the Application will appear in the Software Centre and click Next

6 . Click Add to add a Deployment Type

7 . Select Script Installer from the drop down box and click Next

8 . Specify a Name and click Next

9 . Specify the following information and click Next
- Content Location = We identified the source files in Step 1
- Installation Program = Powershell.exe -ExecutionPolicy Bypass -File “Install_Font.ps1”
- Uninstallation Program = Powershell.exe -ExecutionPolicy Bypass -File “Uninstall_Font.ps1”

10 . Click Add Clause to specify a detection method

11 . Add the Path and File Name of the font and click OK

12 . Click Next
13 . Set the following information and click Next
- Installation Behaviour = Install for System
- Logon Requirement = Whether or not a user is logged on
- Installation Program Visibility = Hidden
- Maximum Allowed Run Time = 15
- Estimated Installation Run Time = 2

14 . Click Add to add a Requirement

15 . Set the Condition to Operating System and select All Windows 10 (64bit) and click OK

16 . Click Next three times and then click Close
17 . Click Next twice
18 . Review the Application Summary and click Close
19 . Right clikc the application and choose Deploy

20 . Choose a Collection to deploy the new application to and click Next

21 . Click Add and choose a Distribution Point or Distribution Point Group and click Next

22 . Choose a Purpose for the deployment, in this example we have chosen to make the application Available in the Software Centre. Click Next

22 . Click Next on the Specify the schedule for this deployment step or set a time/day when this application will be available from
23 . Set the User notifications to something suitable for your environment and click Next

23 . Click Next on the Alerts step or specify a setting suitable for your environment

24 . Click Next, review the deployment and click Close
5 . Observe the Deployment ⏏
If we allow adequate time or force a machine policy refresh on a Windows 10 client targeted for deployment we will see our new app in the Software Centre

Click Install

Launch the Fonts control panel applet to verify the Font has been installed

Summary
In this post we used two fairly simple PowerShell scripts to deploy a single Font to Windows 10 devices. The same scripts can be used to deploy the Font from Intune as a Win32App. See my previous post for an example of how to deploy a Win32App from Intune
https://byteben.com/bb/deploy-custom-microsoft-teams-backgrounds-easily-with-powershell-and-intune/