Windows OS Hub
  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux

 Windows OS Hub / Group Policies / Installing Fonts in Windows Using GPO and PowerShell

February 27, 2023

Installing Fonts in Windows Using GPO and PowerShell

In this article, we’ll show how to install additional fonts on computers in an Active Directory domain using Group Policy and PowerShell script. This guide was tested on current Windows 10 20H2 and Windows Server 2016/2019 builds.

Contents:
  • Deploying New Fonts via GPO
  • Install Windows Fonts Using PowerShell Logon Script

Deploying New Fonts via GPO

If you want to install one or two new fonts, you can do it using the Group Policy. To install a font, copy a *.ttf file to %WindowsDir%\Fonts\ on a client computer and add the new font information to the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts registry key.

  1. Copy the TTF font file to a shared network folder on your file server (if you have only some new fonts, you can store them in SYSVOL folder on your domain controller); copy font files to share folder
  2. Open the domain Group Policy Management console (gpmc.msc), create a new policy GPO_InstallFonts and link it to the OU with computers; create gpo to install fonts
  3. Edit the policy;
  4. Create a new rule in Group Policy Preferences to copy a font file from the shared folder to %WindowsDir%\Fonts\ on your client devices. Earlier we showed how to copy a file to computers using GPO. Create a group policy following these instructions. Go to Computer Configuration -> Preferences -> Windows Settings -> Files. Create a policy entry with the parameters below:Source: \\woshub.com\SYSVOL\woshub.com\scripts\Fonts\Roboto-Black.ttf
    Destination:  %WindowsDir%\Fonts\Roboto-Black.ttfcopy font file to computer using group policy
  5. Now you need to add the information about your new font to the registry. To make changes to the registry using GPO you can also use GPP (Computer Configuration -> Preferences -> Windows Settings -> Registry);
  6. You can specify the font information in the registry manually. However, it is easier to install a font manually on a reference computer and export the font registry settings using a wizard (Computer Configuration -> Preferences -> Windows Settings -> Registry -> New -> Registry Wizard); gpo remote registry browser
  7. Use the Registry Browser to go to HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts reg key on a remote computer. Find and select the registry item containing the name of the font you want to install; select font parameter in the registry
  8. The registry parameter will appear in the GPO editor.

deploy font registry settings using group policy

Then update GPO settings on the client computer and make sure that the new font file has been installed. In Windows 10, you can view the list of installed fonts in the Settings -> Personalization -> Fonts.

new font appeared in Windows 10

If the font file has not been installed, make sure that the policy is assigned to the computer using the gpresult tool. Then follow the usual way for troubleshooting issues with applying GPO settings to computers.

Install Windows Fonts Using PowerShell Logon Script

It is worth to use the font installation method using GPO described above if you want to install some fonts only. If you want to install a lot of new font files at once, it is better to use a PowerShell script, since it may be tiresome to create special policy options for each font.

The following PowerShell script will install all *.ttf and *.otf font files located in the specified shared folder. Also, the script writes all actions to the log file using the WriteLog function.

function WriteLog
{
Param ([string]$LogString)
$Stamp = (Get-Date).toString("yyyy/MM/dd HH:mm:ss")
$LogMessage = "$Stamp $LogString"
Add-content $LogFile -value $LogMessage
}
$Logfile = "C:\Windows\posh_font_install.log"
$SourceFolder = "\\woshub.com\SYSVOL\woshub.com\scripts\Fonts"
Add-Type -AssemblyName System.Drawing
$WindowsFonts = [System.Drawing.Text.PrivateFontCollection]::new()
Get-ChildItem -Path $SourceFolder -Include *.ttf, *.otf -Recurse -File |
Copy-Item -Destination "$env:SystemRoot\Fonts" -Force -Confirm:$false -PassThru |
ForEach-Object {
WriteLog "Installing font file $_.name"
$WindowsFonts.AddFontFile($_.fullname)
$RegistryValue = @{
Path = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts'
Name = $WindowsFonts.Families[-1].Name
Value = $_.Fullname
}
$RemoveRegistry = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts"
Remove-ItemProperty -name $($WindowsFonts.Families[-1].Name) -path $RemoveRegistry
New-ItemProperty @RegistryValue
}

Install new fonts in Windows with a PowerShell script

Save the PowerShell script as a PS1 file and run it as a logon script using GPO.

Thus, all font files from the specified folder will be installed in Windows, and the installation date and time will be logged.

font installation log

If you need to remove all additional fonts in Windows and restore the default ones, follow this guide.
3 comments
3
Facebook Twitter Google + Pinterest
Group PoliciesPowerShellWindows 10Windows Server 2019
previous post
Enable Group Policy Editor (gpedit.msc) on Windows 10/11 Home Edition
next post
Fix: The Computer Restarted Unexpectedly or Encountered an Unexpected Error on Windows

Related Reading

How to Refresh (Update) Group Policy Settings on...

August 13, 2024

Updating List of Trusted Root Certificates in Windows

March 11, 2024

How to Hide or Show User Accounts from...

July 24, 2024

Updating Group Policy Administrative Templates (ADMX)

January 24, 2025

Configuring Password Policy in Active Directory Domain

March 12, 2024

Display System Info on Desktop with BGInfo

February 6, 2025

Troubleshooting: Group Policy (GPO) Not Being Applied to...

March 15, 2024

How to Disable NetBIOS, LLMNR, mDNS Protocols in...

March 20, 2025

3 comments

ryan November 3, 2021 - 8:09 pm

That PS file don’t work

Reply
FSA December 31, 2021 - 9:25 am

It should be %windir%, not %windowsdir%

Reply
David March 18, 2022 - 9:46 am

%windowsdir% is the group policy preferences %windir%, it depends on when you are wanting it to be processed (somethings will not process the latter and will add it as is). Press F3 when creating a preference for the available variables.

Reply

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • Map a Network Drive over SSH (SSHFS) in Windows

    May 13, 2025
  • Configure NTP Time Source for Active Directory Domain

    May 6, 2025
  • Cannot Install Network Adapter Drivers on Windows Server

    April 29, 2025
  • Change BIOS from Legacy to UEFI without Reinstalling Windows

    April 21, 2025
  • How to Prefer IPv4 over IPv6 in Windows Networks

    April 9, 2025
  • Load Drivers from WinPE or Recovery CMD

    March 26, 2025
  • How to Block Common (Weak) Passwords in Active Directory

    March 25, 2025
  • Fix: The referenced assembly could not be found error (0x80073701) on Windows

    March 17, 2025
  • Exclude a Specific User or Computer from Group Policy

    March 12, 2025
  • AD Domain Join: Computer Account Re-use Blocked

    March 11, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Updating List of Trusted Root Certificates in Windows
  • Configure Google Chrome Settings with Group Policy
  • Configuring FSLogix Profile Containers on Windows Server RDS
  • How to Find the Source of Account Lockouts in Active Directory
  • How to Disable or Enable USB Drives in Windows using Group Policy
  • How to Hide or Show User Accounts from Login Screen on Windows
  • Changing Default File Associations in Windows 10 and 11
Footer Logo

@2014 - 2024 - Windows OS Hub. All about operating systems for sysadmins


Back To Top