Similar to Word, there is also a template file for e-mails in Outlook. This Outlook / Mail template can be easily distributed with Intune and a PowerShell Script or Win32 App. Unfortunately, not all settings are included in it. In addition, there are some registry entries that are required for the standard font etc.
How you can distribute the "Normal.dotm" for Word I show you here.
Table of Contents
- PowerShell to distribute the Outlook template
- Create and upload Win32 app
- Proactive Remediations for "Stationery and Fonts"
- Distribute the update of the Outlook template
PowerShell to distribute the Outlook template
The script consists of two parts. In the first, the registry entries for the standard fonts for new mails and replies are set. In the second, I distribute the "NormalEmail.dotm" to also have the format templates under "Format Text".
To start, download the whole package using the button above.
Unfortunately, the writing (stationery and fonts) is only activated for users if Outlook was already open.
If you want to make sure that the font is always up-to-date for all users, I recommend creating a Proactive Remediations package for it.
In the first lines you have to specify the desired fonts and sizes. These are in a binary format. But don't worry, you can simply click together the settings in Outlook and then insert the variables in the script.
To do this, navigate in Outlook under "File > Options > Mail > Stationery and Fonts".
Here you can now prepare the settings.
Please do not use any special / custom fonts. These are displayed unformatted for external recipients.
You can now find the settings you have made in the Registry Editor under:
Computer\HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common\MailSettings
However, you cannot simply copy them out here. I have put together the following PowerShell commands for you. Select this and copy the output into the "install.ps1" in the "Font Settings Outlook".
Tipp: Execute each line individually and keep the overview better.
$($(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Common\MailSettings").ComposeFontComplex -join ",")
$($(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Common\MailSettings").ComposeFontSimple -join ",")
$($(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Common\MailSettings").ReplyFontComplex -join ",")
$($(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Common\MailSettings").ReplyFontSimple -join ",")
$($(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Common\MailSettings").TextFontComplex -join ",")
$($(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Office\16.0\Common\MailSettings").TextFontSimple -join ",")
Code language: PowerShell (powershell)
Here is an example of executing the first line. You then copy the output into the variable $ComposeFontComplex
between the two "".
# Font Settings Outlook
$ComposeFontComplex = "60,104,116,109,108,62...."
$ComposeFontSimple = ""
$MarkCommentsWith = ""
$ReplyFontComplex = ""
$ReplyFontSimple = ""
$TextFontComplex = ""
$TextFontSimple = ""
Code language: PowerShell (powershell)
The easiest way to prepare the "NormalEmail.dotm" is in Word. You can download my version from GitHub or rename an existing "Normal.dotm" to "NormalEmail.dotm" and customize it to suit you.
You don't have to change anything in the script to configure this file, just put it in the package and create a Win32 app from it.
With the "NormalEmail.dotm" you set the format templates in Outlook:
Create and upload Win32 app
As soon as you have filled in the registry keys and put your "NormalEmail.dotm" file in the folder, you can create a Win32 app from the whole thing. To do this, proceed as follows:
- Download the current "Microsoft Win32 Content Prep Tool" down.
- Open the tool and enter the following variables:
- Path to the folder, for example: C:\GitHub\scloud\Normal mail template
- install.ps1
- Path to the folder, for example: C:\GitHub\scloud\Normal mail template
You will then find the finished win32 app with the name "install.intunewin" in the specified folder and can use it in the Microsoft Endpoint Manager under "Apps > Windows +Add" upload.
In the first step you enter at least a name, a description and a publisher. In the second you have to enter the following installation and deinstallation command.
It is also important that the installation context "users" is selected.
install command | %SystemRoot%\sysnative\WindowsPowerShell\v1.0\powershell.exe -windowstyle hidden -executionpolicy bypass -command .\install.ps1 |
uninstall command | %SystemRoot%\sysnative\WindowsPowerShell\v1.0\powershell.exe -windowstyle hidden -executionpolicy bypass -command .\uninstall.ps1 |
In the "Requirements" make sure that your managed operating systems are supported. There is no special requirement apart from Office 2016.
With the "Detection Rule" you can upload the prepared "check.ps1" file from my template.
We have no dependencies and only have to assign the package to the desired group at the end. If you wait a bit or install the app via Company Portal, the user has received the default Outlook template via Intune and you can update or delete it at any time.
Proactive Remediations for "Stationery and Fonts"
If Win32 was installed on a PC before Outlook was first started, the "Stationery and Fonts" values will be overwritten. To make sure the fonts are correct, you can create a Proactive Remediations package. As usual, I have put the template for you on GitHub.
Fill in the registry values in the detection and remediation script as described above in the WIn32 app and distribute the package user-based.
Distribute the update of the Outlook template
If you want to update your template, you can do this by adjusting the "NormalEmail.dotm" and / or the registry entries and adjusting the version in the second line of "install.ps1" and "check.ps1". You can then repackage the Win32 app and upload it to the existing app in the Endpoint Manager. Don't forget to re-upload the "check.ps1" too!
Hello Florian.
Quick question.
When i deploy this as a WIN32 app, it first says installed and a second later it's says failed... do you have any suggestions?
If this happens, it definitely failed. Sometimes the Company Portal is a bit too slow 😉
I made some tweaks and uploaded the newest version to my GitHub.
Hallöchen,
vielen Dank erstmal für die Anleitung. Bei mir schlägt die Verteilung leider laut log wie folgt fehl:
PS>TerminatingError(): "Der Wert "1
14" kann nicht in den Typ "System.Byte" konvertiert werden. Fehler: "Die Eingabezeichenfolge hat das falsche Format.""
>> TerminatingError(): "Der Wert "1
14" kann nicht in den Typ "System.Byte" konvertiert werden. Fehler: "Die Eingabezeichenfolge hat das falsche Format.""
Der Wert "1
14" kann nicht in den Typ "System.Byte" konvertiert werden. Fehler: "Die Eingabezeichenfolge hat das falsche Format."
Der Wert "1
14" kann nicht in den Typ "System.Byte" konvertiert werden. Fehler: "Die Eingabezeichenfolge hat das falsche Format."
Die Werte habe ich jetzt 3x neu kopiert. Immer wieder derselbe Fehler. Geht um M365 Apps for Business.
Werte sehen so aus:
$ComposeFontComplex = "60,104,116,109,108,62,13,10,13,10,60,104,101,97,100,62,13,10,60,115,116,121,108,101,62,13,10,13,10,32,47,42,32,83,116,121,108,101,32,68,101,102,105,110,105,116,105,111,110,115,32,42,47,13,10,32,115,112,97,110,46,80,101,114,115,110,108,105,99,104,101,114,69,1
14,115,116,101,108,108,115,116,105,108,13,10,9,123,109,115,111,45,115,116,121,108,101,45,110,97,109,101,58,34,80,101,114,115,246,110,108,105,99,104,101,114,32,69,114,115,116,101,108,108,115,116,105,108,34,59,13,10,9,109,115,111,45,115,116,121,108,101,45,116,
121,112,101,58,112,101,114,115,111,110,97,108,45,99,111,109,112,111,115,101,59,13,10,9,109,115,111,45,115,116,121,108,101,45,110,111,115,104,111,119,58,121,101,115,59,13,10,9,109,115,111,45,115,116,121,108,101,45,117,110,104,105,100,101,58,110,111,59,13,10,9
,109,115,111,45,97,110,115,105,45,102,111,110,116,45,115,105,122,101,58,49,48,46,48,112,116,59,13,10,9,109,115,111,45,98,105,100,105,45,102,111,110,116,45,115,105,122,101,58,49,49,46,48,112,116,59,13,10,9,102,111,110,116,45,102,97,109,105,108,121,58,34,86,10
1,114,100,97,110,97,34,44,115,97,110,115,45,115,101,114,105,102,59,13,10,9,109,115,111,45,97,115,99,105,105,45,102,111,110,116,45,102,97,109,105,108,121,58,86,101,114,100,97,110,97,59,13,10,9,109,115,111,45,104,97,110,115,105,45,102,111,110,116,45,102,97,109
,105,108,121,58,86,101,114,100,97,110,97,59,13,10,9,109,115,111,45,98,105,100,105,45,102,111,110,116,45,102,97,109,105,108,121,58,34,84,105,109,101,115,32,78,101,119,32,82,111,109,97,110,34,59,13,10,9,109,115,111,45,98,105,100,105,45,116,104,101,109,101,45,1
02,111,110,116,58,109,105,110,111,114,45,98,105,100,105,59,13,10,9,99,111,108,111,114,58,119,105,110,100,111,119,116,101,120,116,59,125,13,10,45,45,62,13,10,60,47,115,116,121,108,101,62,13,10,60,47,104,101,97,100,62,13,10,13,10,60,47,104,116,109,108,62,13,10"
$ComposeFontSimple = "60,0,0,0,31,0,0,248,0,0,0,64,200,0,0,0,0,0,0,0,0,0,0,255,0,34,86,101,114,100,97,110,97,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"
$ReplyFontComplex = "60,104,116,109,108,62,13,10,13,10,60,104,101,97,100,62,13,10,60,115,116,121,108,101,62,13,10,13,10,32,47,42,32,83,116,121,108,101,32,68,101,102,105,110,105,116,105,111,110,115,32,42,47,13,10,32,115,112,97,110,46,80,101,114,115,110,108,105,99,104,101,114,65,1
10,116,119,111,114,116,115,116,105,108,13,10,9,123,109,115,111,45,115,116,121,108,101,45,110,97,109,101,58,34,80,101,114,115,246,110,108,105,99,104,101,114,32,65,110,116,119,111,114,116,115,116,105,108,34,59,13,10,9,109,115,111,45,115,116,121,108,101,45,116,
121,112,101,58,112,101,114,115,111,110,97,108,45,114,101,112,108,121,59,13,10,9,109,115,111,45,115,116,121,108,101,45,110,111,115,104,111,119,58,121,101,115,59,13,10,9,109,115,111,45,115,116,121,108,101,45,117,110,104,105,100,101,58,110,111,59,13,10,9,109,11
5,111,45,97,110,115,105,45,102,111,110,116,45,115,105,122,101,58,49,48,46,48,112,116,59,13,10,9,109,115,111,45,98,105,100,105,45,102,111,110,116,45,115,105,122,101,58,49,49,46,48,112,116,59,13,10,9,102,111,110,116,45,102,97,109,105,108,121,58,34,86,101,114,1
00,97,110,97,34,44,115,97,110,115,45,115,101,114,105,102,59,13,10,9,109,115,111,45,97,115,99,105,105,45,102,111,110,116,45,102,97,109,105,108,121,58,86,101,114,100,97,110,97,59,13,10,9,109,115,111,45,104,97,110,115,105,45,102,111,110,116,45,102,97,109,105,10
8,121,58,86,101,114,100,97,110,97,59,13,10,9,109,115,111,45,98,105,100,105,45,102,111,110,116,45,102,97,109,105,108,121,58,34,84,105,109,101,115,32,78,101,119,32,82,111,109,97,110,34,59,13,10,9,109,115,111,45,98,105,100,105,45,116,104,101,109,101,45,102,111,
110,116,58,109,105,110,111,114,45,98,105,100,105,59,13,10,9,99,111,108,111,114,58,119,105,110,100,111,119,116,101,120,116,59,125,13,10,45,45,62,13,10,60,47,115,116,121,108,101,62,13,10,60,47,104,101,97,100,62,13,10,13,10,60,47,104,116,109,108,62,13,10"
$ReplyFontSimple = "60,0,0,0,31,0,0,248,0,0,0,64,200,0,0,0,0,0,0,0,0,0,0,255,0,34,86,101,114,100,97,110,97,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"
$TextFontComplex = "60,104,116,109,108,62,13,10,13,10,60,104,101,97,100,62,13,10,60,115,116,121,108,101,62,13,10,13,10,32,47,42,32,83,116,121,108,101,32,68,101,102,105,110,105,116,105,111,110,115,32,42,47,13,10,32,112,46,77,115,111,80,108,97,105,110,84,101,120,116,44,32,108,105
,46,77,115,111,80,108,97,105,110,84,101,120,116,44,32,100,105,118,46,77,115,111,80,108,97,105,110,84,101,120,116,13,10,9,123,109,115,111,45,115,116,121,108,101,45,110,111,115,104,111,119,58,121,101,115,59,13,10,9,109,115,111,45,115,116,121,108,101,45,112,114
,105,111,114,105,116,121,58,57,57,59,13,10,9,109,115,111,45,115,116,121,108,101,45,108,105,110,107,58,34,78,117,114,32,84,101,120,116,32,90,99,104,110,34,59,13,10,9,109,97,114,103,105,110,58,48,99,109,59,13,10,9,109,115,111,45,112,97,103,105,110,97,116,105,1
11,110,58,119,105,100,111,119,45,111,114,112,104,97,110,59,13,10,9,102,111,110,116,45,115,105,122,101,58,49,48,46,48,112,116,59,13,10,9,109,115,111,45,98,105,100,105,45,102,111,110,116,45,115,105,122,101,58,49,48,46,53,112,116,59,13,10,9,102,111,110,116,45,1
02,97,109,105,108,121,58,34,86,101,114,100,97,110,97,34,44,115,97,110,115,45,115,101,114,105,102,59,13,10,9,109,115,111,45,102,97,114,101,97,115,116,45,102,111,110,116,45,102,97,109,105,108,121,58,67,97,108,105,98,114,105,59,13,10,9,109,115,111,45,102,97,114
,101,97,115,116,45,116,104,101,109,101,45,102,111,110,116,58,109,105,110,111,114,45,108,97,116,105,110,59,13,10,9,109,115,111,45,98,105,100,105,45,102,111,110,116,45,102,97,109,105,108,121,58,34,84,105,109,101,115,32,78,101,119,32,82,111,109,97,110,34,59,13,
10,9,109,115,111,45,98,105,100,105,45,116,104,101,109,101,45,102,111,110,116,58,109,105,110,111,114,45,98,105,100,105,59,13,10,9,109,115,111,45,102,111,110,116,45,107,101,114,110,105,110,103,58,49,46,48,112,116,59,13,10,9,109,115,111,45,108,105,103,97,116,11
7,114,101,115,58,115,116,97,110,100,97,114,100,99,111,110,116,101,120,116,117,97,108,59,13,10,9,109,115,111,45,102,97,114,101,97,115,116,45,108,97,110,103,117,97,103,101,58,69,78,45,85,83,59,125,13,10,45,45,62,13,10,60,47,115,116,121,108,101,62,13,10,60,47,1
04,101,97,100,62,13,10,13,10,60,47,104,116,109,108,62,13,10"
$TextFontSimple = "60,0,0,0,31,0,0,248,0,0,0,64,200,0,0,0,0,0,0,0,0,0,0,255,0,34,86,101,114,100,97,110,97,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"
siehst du da einen Fehler?
Hallo Sven, hast du in deinem Script bei den werten Zeilenumschläge drin? Falls ja, entferne diese bitte und versuch es noch einmal.
Hallo Florian,
sorry für das späte Feedback. Es waren tatsächlich die Zeilenumschläge. Hatte es nur mit Copy&Paste rüberkopiert.
Vielen Dank!
Hauptsache es hat nun geklappt 🙂
Hi Florian,
I want to thank you for these templates as they have been very usefull for me.
I would like to mention a flaw I encountered with the specific Outlook template check.ps1
It's making a reference to $Path_4Log\Validation\$PackageName"
When I tried pushing the application it said it failed because it couldn't detect the app.
$Path_local\Validation\$PackageName" however worked and when I changed it in the script it installed succesfully. The main issue is that the template keeps trying to install itself every day prompting outlook to restart. Nevertheless I have learned and this helped me by a lot. Thanks you again for creating this.
The script worked perfectly. Could you tell me if there is any way to prohibit the user from changing the font, as I realized that he can change it if he wants and because he doesn't have a Microsoft 365 E5 license I don't have Proactive Remediations, so because I have Microsoft 365 Business Premium I just made the Win32 application and had it deployed to users and it worked perfectly. Now I needed help to prohibit the font change.
It is not possible to prevent the user from changing the font, but you can use the detection rule from the remediation package as a detection rule in your Win32 application or create a scheduled task to solve the remediation.
For the task, you can use this blog as a reference: https://scloud.work/proactive-remediation-for-business/
Hey, thanks for your scripts, they've been very useful so far!
Are the reg file changes neccesary for this? If I just replace the NormalEmail.dotm template with my own then that seems to do the job?
This depends on your needs 😉
The NormalEmail.dotmm defines the style template and the registry keys the default font for new mails and replies etc.
If just the NormalEmail is enough for you, thats good too.
Thank you very much, works great. Get rid of Aptos.
We now set it default for everyone.