Deploying fonts as an application has worked so far. While it accomplishes my goal of installing fonts (without visiting every single machine), it has two downsides. First, Group Policy Software Installation requires a reboot to process. Second, an administrator is still needed to package the MSI. Because I love automation, this drove me crazy! How can I get out of the font deploying business? Let my users start installing fonts with PowerShell.
Using VB to Install Fonts with PowerShell
Ok – so it isn’t as easy as a single cmdlet. But I did find a PowerShell script that was based on a VB Script. The problem: beginning in Windows 7, fonts could not be installed from a Network Location. The solution: a simple Copy-Item command. Without further ado, here is our script:
$NetworkPath = \\SERVER\SHARE\Fonts\
#Local Location (temp place to store fonts)
$FONTS = 0x14
$objShell = New-Object -ComObject Shell.Application
$objFolder = $objShell.Namespace($FONTS)
New-Item $LocalPath -type directory -Force
Copy-Item "$NetworkPath\*" $LocalPath
$Fontdir = dir $LocalPath
foreach($File in $Fontdir)
if ((Test-Path "C:\Windows\Fonts\$File") -eq $False)
The only configuration needed is to set the NetworkPath variable. Fonts should be placed directly into this folder without any sub-folders. If desired, you can change the LocalPath variable to a hidden location. Either way, our script will create the local font storage folder and copy any item from the network location to the local machine. The script will then install and register each Font by using the Windows Font viewer. This keeps us from manually having to edit the registry. Finally, our script runs a Test-Path check to ensure we are overwriting existing fonts.
Group Policy Preferences
To delegate this task, we are going to use Group Policy Preferences: Scheduled Tasks. Create a new GPO named Install Fonts – then create a new preference. Change the Task user from your account to a dedicated service account. Remember that this account will need read access to your network share and will need to be a local administrator of any machine that will need fonts. This user will also need the Run as Batch permission.
On the Triggers Tab, create a new Daily trigger. Set it to repeat at a regular interval. Because my users are used to waiting an hour or so for other preferences to apply, I set mine to an hour. Depending your user’s patience, you can have the task repeat up to every 5 minutes.
On the Actions Tab, create a new action that calls PowerShell.exe. For your arguments, specify -noprofile “PATH-TO-YOUR-SCRIPT.PS1”
And that is it! Every time your Task runs, it will automatically install the new drivers. You can allow your users to write new files to your network location and use File Screening to ensure that only font files are added! If you have any issues or questions, just let me know.
Original Script Source can be found here.