Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

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

September 10, 2021 Group PoliciesPowerShellWindows 10Windows Server 2019

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.ttf

    copy 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
1
Facebook Twitter Google + Pinterest
previous post
Enable Group Policy Editor (gpedit.msc) on Windows 10/11 Home Edition
next post
Installing RSAT Administration Tools on Windows 10 and 11

Related Reading

Using Previous Command History in PowerShell Console

January 31, 2023

How to Install the PowerShell Active Directory Module...

January 31, 2023

Enable Internet Explorer (IE) Compatibility Mode in Microsoft...

January 27, 2023

Finding Duplicate E-mail (SMTP) Addresses in Exchange

January 27, 2023

How to Disable or Uninstall Internet Explorer (IE)...

January 26, 2023

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

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • Using Previous Command History in PowerShell Console

    January 31, 2023
  • How to Install the PowerShell Active Directory Module and Manage AD?

    January 31, 2023
  • Finding Duplicate E-mail (SMTP) Addresses in Exchange

    January 27, 2023
  • How to Delete Old User Profiles in Windows?

    January 25, 2023
  • How to Install Free VMware Hypervisor (ESXi)?

    January 24, 2023
  • How to Enable TLS 1.2 on Windows?

    January 18, 2023
  • Allow or Prevent Non-Admin Users from Reboot/Shutdown Windows

    January 17, 2023
  • Fix: Can’t Extend Volume in Windows

    January 12, 2023
  • Wi-Fi (Internet) Disconnects After Sleep or Hibernation on Windows 10/11

    January 11, 2023
  • Adding Trusted Root Certificates on Linux

    January 9, 2023

Follow us

woshub.com
  • Facebook
  • Twitter
  • RSS
Popular Posts
  • Updating List of Trusted Root Certificates in Windows
  • Configure Google Chrome Settings with Group Policy
  • Allow RDP Access to Domain Controller for Non-admin Users
  • How to Find the Source of Account Lockouts in Active Directory?
  • How to Hide or Show User Accounts from Login Screen on Windows 10/11?
  • Reset Local Group Policy Settings in Windows
  • Configuring Proxy Settings on Windows Using Group Policy Preferences
Footer Logo

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


Back To Top