PowerShell script to change font of office apps

Copper Contributor
Hi,

We are using Microsoft 365 for Enterprise for delivery office apps to users via Microsoft Intune.

Currently the default font for all office apps is Calibri and now users want that it should change to Arial, 11 font.

Is there a way in Powershell to make that change.
I have been suggested ways to do it with .net objects or Interop.

Can someone please share a sample PowerShell script or a full script to make that change.

Thanks,
Ashish Arya
17 Replies

@ashisharya 

Hi Ashish,

 

are you able to clarify are you wanting to just change the default settings for new documents? or are you wanting to retro-fix existing documents as well?

 

If it's just changing the default settings for word/outlook then the easiest method is to update the Normal.dotx / NormalEmail.dotm file on a device and replace the versions on the rest of the devices with the updated ones...

 

quick steps for creation

1 - update Normal.dotx / NormalEmail.dotm and save to a folder

2 - create a PowerShell script to copy the above files to the correct location - you will want to include something in the script to write a file or a reg key that you can use in the detection rules in MEM

copy-item -path .\Normal.dotx -destination $env:Appdata\Microsoft\Templates -force
copy-item -path .\NormalEmail.dotm -destination $env:Appdata\Microsoft\Templates -force

3 - using the Microsoft Win32 Content Prep tool make an .intunewin containing the script and the new files

4 - upload to MEM as Win32 application and configure detection rules etc

5 - link Win32 Application to a device and test

 

if you are wanting to reto-fix existing documents then that becomes a bit more complex... I was trying to find the example for this that explained the process of doing this (came out around the same time they introduced the new file format). but basically the new office format documents are really just zip files containing XML files. styles.xml contains the document styles so this xml file could be pulled out of a document manually updated then write a PS script to loop through a document share etc, and open the file as an archive and inject this updated xml file.

 

hope that helps 

 

Regards

 

Steve:)

@SteveMacNZ 

 

Hi Steve, this is exactly what I am looking for to be able to change Outlook's default font on all of our organisations devices. Would you be able to provide more details of the PS script so I can replicate this on our machines? Any help would be greatly appreciated. Thanks Jason

@Jason275: Jason I have been able to achieve this by replacing my custom Normal.dotm file (stored at the Azure blob) with the default Normal.dotm file located at %appdata%\Microsoft\Templates (the default location of word and Outlook templates).

 

Below are the steps that I took for changing fonts for Word and same can be tried for Outlook as well.

 

1. I pushed out a PS script (Schdtask) from Intune to create a scheduled task on all Intune devices.

2. This task will run another PS script(LogonScript) stored at the same Azure blob whenever there is a user login.

2. This LogonScript will first remove the default Normal.dotm file.

3. Then it will then connect to the same Azure blob and get our custom Normal.dotm file and place it under the same default template location.

 

I am sure this is not the best solution to go with but this can be tried if you have no other choice.

 

I will also be keen to get any other solution for this.

 

Regards,

Ashish Arya

Another option would be to copy to the default profile which is copied each time a new user logs on - which would negate the need for the scheduled task...
Pulling from Azure Blob is a good idea - just make sure that you include the detection so it only downloads the file from Blob if it is changed

I must admit @Ashish_Arya I'm not really sure how to achieve this through your suggestion as I'm quite new to this.

@SteveMacNZI like the sound of your option but not sure where to find the default profile in the registry, I can only see the HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Common\MailSettings. Any further help would be greatly appreciated. Thanks Jason

This is my script, it works when I run it locally but won't deploy when I roll it out through Intune:

cd HKCU:\SOFTWARE\Microsoft\Office\16.0\Common\MailSettings
Get-Item -path ./
Set-ItemProperty -path ./ -Name ‘NewTheme’ -Value ('')
Set-ItemProperty -path ./ -Name ‘MarkCommentsWith’ -Value ([byte[]](0x00,0x00))
Set-ItemProperty -path ./ -Name ‘ComposeFontComplex’ -Value ([byte[]](0x3c,0x68,0x74,0x6d,0x6c,0x3e,0x0d,0x0a,0x0d,0x0a,0x3c,0x68,0x65,0x61,0x64,0x3e,0x0d,0x0a,0x3c,0x73,0x74,0x79,0x6c,0x65,0x3e,0x0d,0x0a,0x0d,0x0a,0x20,0x2f,0x2a,0x20,0x53,0x74,0x79,0x6c,0x65,0x20,0x44,0x65,0x66,0x69,0x6e,0x69,0x74,0x69,0x6f,0x6e,0x73,0x20,0x2a,0x2f,0x0d,0x0a,0x20,0x73,0x70,0x61,0x6e,0x2e,0x50,0x65,0x72,0x73,0x6f,0x6e,0x61,0x6c,0x43,0x6f,0x6d,0x70,0x6f,0x73,0x65,0x53,0x74,0x79,0x6c,0x65,0x0d,0x0a,0x09,0x7b,0x6d,0x73,0x6f,0x2d,0x73,0x74,0x79,0x6c,0x65,0x2d,0x6e,0x61,0x6d,0x65,0x3a,0x22,0x50,0x65,0x72,0x73,0x6f,0x6e,0x61,0x6c,0x20,0x43,0x6f,0x6d,0x70,0x6f,0x73,0x65,0x20,0x53,0x74,0x79,0x6c,0x65,0x22,0x3b,0x0d,0x0a,0x09,0x6d,0x73,0x6f,0x2d,0x73,0x74,0x79,0x6c,0x65,0x2d,0x74,0x79,0x70,0x65,0x3a,0x70,0x65,0x72,0x73,0x6f,0x6e,0x61,0x6c,0x2d,0x63,0x6f,0x6d,0x70,0x6f,0x73,0x65,0x3b,0x0d,0x0a,0x09,0x6d,0x73,0x6f,0x2d,0x73,0x74,0x79,0x6c,0x65,0x2d,0x6e,0x6f,0x73,0x68,0x6f,0x77,0x3a,0x79,0x65,0x73,0x3b,0x0d,0x0a,0x09,0x6d,0x73,0x6f,0x2d,0x73,0x74,0x79,0x6c,0x65,0x2d,0x75,0x6e,0x68,0x69,0x64,0x65,0x3a,0x6e,0x6f,0x3b,0x0d,0x0a,0x09,0x6d,0x73,0x6f,0x2d,0x61,0x6e,0x73,0x69,0x2d,0x66,0x6f,0x6e,0x74,0x2d,0x73,0x69,0x7a,0x65,0x3a,0x31,0x30,0x2e,0x30,0x70,0x74,0x3b,0x0d,0x0a,0x09,0x6d,0x73,0x6f,0x2d,0x62,0x69,0x64,0x69,0x2d,0x66,0x6f,0x6e,0x74,0x2d,0x73,0x69,0x7a,0x65,0x3a,0x31,0x31,0x2e,0x30,0x70,0x74,0x3b,0x0d,0x0a,0x09,0x66,0x6f,0x6e,0x74,0x2d,0x66,0x61,0x6d,0x69,0x6c,0x79,0x3a,0x22,0x56,0x65,0x72,0x64,0x61,0x6e,0x61,0x22,0x2c,0x73,0x61,0x6e,0x73,0x2d,0x73,0x65,0x72,0x69,0x66,0x3b,0x0d,0x0a,0x09,0x6d,0x73,0x6f,0x2d,0x61,0x73,0x63,0x69,0x69,0x2d,0x66,0x6f,0x6e,0x74,0x2d,0x66,0x61,0x6d,0x69,0x6c,0x79,0x3a,0x56,0x65,0x72,0x64,0x61,0x6e,0x61,0x3b,0x0d,0x0a,0x09,0x6d,0x73,0x6f,0x2d,0x68,0x61,0x6e,0x73,0x69,0x2d,0x66,0x6f,0x6e,0x74,0x2d,0x66,0x61,0x6d,0x69,0x6c,0x79,0x3a,0x56,0x65,0x72,0x64,0x61,0x6e,0x61,0x3b,0x0d,0x0a,0x09,0x6d,0x73,0x6f,0x2d,0x62,0x69,0x64,0x69,0x2d,0x66,0x6f,0x6e,0x74,0x2d,0x66,0x61,0x6d,0x69,0x6c,0x79,0x3a,0x22,0x54,0x69,0x6d,0x65,0x73,0x20,0x4e,0x65,0x77,0x20,0x52,0x6f,0x6d,0x61,0x6e,0x22,0x3b,0x0d,0x0a,0x09,0x6d,0x73,0x6f,0x2d,0x62,0x69,0x64,0x69,0x2d,0x74,0x68,0x65,0x6d,0x65,0x2d,0x66,0x6f,0x6e,0x74,0x3a,0x6d,0x69,0x6e,0x6f,0x72,0x2d,0x62,0x69,0x64,0x69,0x3b,0x0d,0x0a,0x09,0x63,0x6f,0x6c,0x6f,0x72,0x3a,0x77,0x69,0x6e,0x64,0x6f,0x77,0x74,0x65,0x78,0x74,0x3b,0x7d,0x0d,0x0a,0x2d,0x2d,0x3e,0x0d,0x0a,0x3c,0x2f,0x73,0x74,0x79,0x6c,0x65,0x3e,0x0d,0x0a,0x3c,0x2f,0x68,0x65,0x61,0x64,0x3e,0x0d,0x0a,0x0d,0x0a,0x3c,0x2f,0x68,0x74,0x6d,0x6c,0x3e,0x0d,0x0a))
Set-ItemProperty -path ./ -Name ‘ComposeFontSimple’ -Value ([byte[]](0x3c,0x00,0x00,0x00,0x1f,0x00,0x00,0xf8,0x00,0x00,0x00,0x40,0xc8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x22,0x56,0x65,0x72,0x64,0x61,0x6e,0x61,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00))
Set-ItemProperty -path ./ -Name ‘ReplyFontComplex’ -Value ([byte[]](0x3c,0x68,0x74,0x6d,0x6c,0x3e,0x0d,0x0a,0x0d,0x0a,0x3c,0x68,0x65,0x61,0x64,0x3e,0x0d,0x0a,0x3c,0x73,0x74,0x79,0x6c,0x65,0x3e,0x0d,0x0a,0x0d,0x0a,0x20,0x2f,0x2a,0x20,0x53,0x74,0x79,0x6c,0x65,0x20,0x44,0x65,0x66,0x69,0x6e,0x69,0x74,0x69,0x6f,0x6e,0x73,0x20,0x2a,0x2f,0x0d,0x0a,0x20,0x73,0x70,0x61,0x6e,0x2e,0x50,0x65,0x72,0x73,0x6f,0x6e,0x61,0x6c,0x52,0x65,0x70,0x6c,0x79,0x53,0x74,0x79,0x6c,0x65,0x0d,0x0a,0x09,0x7b,0x6d,0x73,0x6f,0x2d,0x73,0x74,0x79,0x6c,0x65,0x2d,0x6e,0x61,0x6d,0x65,0x3a,0x22,0x50,0x65,0x72,0x73,0x6f,0x6e,0x61,0x6c,0x20,0x52,0x65,0x70,0x6c,0x79,0x20,0x53,0x74,0x79,0x6c,0x65,0x22,0x3b,0x0d,0x0a,0x09,0x6d,0x73,0x6f,0x2d,0x73,0x74,0x79,0x6c,0x65,0x2d,0x74,0x79,0x70,0x65,0x3a,0x70,0x65,0x72,0x73,0x6f,0x6e,0x61,0x6c,0x2d,0x72,0x65,0x70,0x6c,0x79,0x3b,0x0d,0x0a,0x09,0x6d,0x73,0x6f,0x2d,0x73,0x74,0x79,0x6c,0x65,0x2d,0x6e,0x6f,0x73,0x68,0x6f,0x77,0x3a,0x79,0x65,0x73,0x3b,0x0d,0x0a,0x09,0x6d,0x73,0x6f,0x2d,0x73,0x74,0x79,0x6c,0x65,0x2d,0x75,0x6e,0x68,0x69,0x64,0x65,0x3a,0x6e,0x6f,0x3b,0x0d,0x0a,0x09,0x6d,0x73,0x6f,0x2d,0x61,0x6e,0x73,0x69,0x2d,0x66,0x6f,0x6e,0x74,0x2d,0x73,0x69,0x7a,0x65,0x3a,0x31,0x30,0x2e,0x30,0x70,0x74,0x3b,0x0d,0x0a,0x09,0x6d,0x73,0x6f,0x2d,0x62,0x69,0x64,0x69,0x2d,0x66,0x6f,0x6e,0x74,0x2d,0x73,0x69,0x7a,0x65,0x3a,0x31,0x31,0x2e,0x30,0x70,0x74,0x3b,0x0d,0x0a,0x09,0x66,0x6f,0x6e,0x74,0x2d,0x66,0x61,0x6d,0x69,0x6c,0x79,0x3a,0x22,0x56,0x65,0x72,0x64,0x61,0x6e,0x61,0x22,0x2c,0x73,0x61,0x6e,0x73,0x2d,0x73,0x65,0x72,0x69,0x66,0x3b,0x0d,0x0a,0x09,0x6d,0x73,0x6f,0x2d,0x61,0x73,0x63,0x69,0x69,0x2d,0x66,0x6f,0x6e,0x74,0x2d,0x66,0x61,0x6d,0x69,0x6c,0x79,0x3a,0x56,0x65,0x72,0x64,0x61,0x6e,0x61,0x3b,0x0d,0x0a,0x09,0x6d,0x73,0x6f,0x2d,0x68,0x61,0x6e,0x73,0x69,0x2d,0x66,0x6f,0x6e,0x74,0x2d,0x66,0x61,0x6d,0x69,0x6c,0x79,0x3a,0x56,0x65,0x72,0x64,0x61,0x6e,0x61,0x3b,0x0d,0x0a,0x09,0x6d,0x73,0x6f,0x2d,0x62,0x69,0x64,0x69,0x2d,0x66,0x6f,0x6e,0x74,0x2d,0x66,0x61,0x6d,0x69,0x6c,0x79,0x3a,0x22,0x54,0x69,0x6d,0x65,0x73,0x20,0x4e,0x65,0x77,0x20,0x52,0x6f,0x6d,0x61,0x6e,0x22,0x3b,0x0d,0x0a,0x09,0x6d,0x73,0x6f,0x2d,0x62,0x69,0x64,0x69,0x2d,0x74,0x68,0x65,0x6d,0x65,0x2d,0x66,0x6f,0x6e,0x74,0x3a,0x6d,0x69,0x6e,0x6f,0x72,0x2d,0x62,0x69,0x64,0x69,0x3b,0x0d,0x0a,0x09,0x63,0x6f,0x6c,0x6f,0x72,0x3a,0x77,0x69,0x6e,0x64,0x6f,0x77,0x74,0x65,0x78,0x74,0x3b,0x7d,0x0d,0x0a,0x2d,0x2d,0x3e,0x0d,0x0a,0x3c,0x2f,0x73,0x74,0x79,0x6c,0x65,0x3e,0x0d,0x0a,0x3c,0x2f,0x68,0x65,0x61,0x64,0x3e,0x0d,0x0a,0x0d,0x0a,0x3c,0x2f,0x68,0x74,0x6d,0x6c,0x3e,0x0d,0x0a))
Set-ItemProperty -path ./ -Name ‘ReplyFontSimple’ -Value ([byte[]](0x3c,0x00,0x00,0x00,0x1f,0x00,0x00,0xf8,0x00,0x00,0x00,0x40,0xc8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x22,0x56,0x65,0x72,0x64,0x61,0x6e,0x61,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00))
Set-ItemProperty -path ./ -Name ‘TextFontComplex’ -Value ([byte[]](0x3c,0x68,0x74,0x6d,0x6c,0x3e,0x0d,0x0a,0x0d,0x0a,0x3c,0x68,0x65,0x61,0x64,0x3e,0x0d,0x0a,0x3c,0x73,0x74,0x79,0x6c,0x65,0x3e,0x0d,0x0a,0x0d,0x0a,0x20,0x2f,0x2a,0x20,0x53,0x74,0x79,0x6c,0x65,0x20,0x44,0x65,0x66,0x69,0x6e,0x69,0x74,0x69,0x6f,0x6e,0x73,0x20,0x2a,0x2f,0x0d,0x0a,0x20,0x70,0x2e,0x4d,0x73,0x6f,0x50,0x6c,0x61,0x69,0x6e,0x54,0x65,0x78,0x74,0x2c,0x20,0x6c,0x69,0x2e,0x4d,0x73,0x6f,0x50,0x6c,0x61,0x69,0x6e,0x54,0x65,0x78,0x74,0x2c,0x20,0x64,0x69,0x76,0x2e,0x4d,0x73,0x6f,0x50,0x6c,0x61,0x69,0x6e,0x54,0x65,0x78,0x74,0x0d,0x0a,0x09,0x7b,0x6d,0x73,0x6f,0x2d,0x73,0x74,0x79,0x6c,0x65,0x2d,0x6e,0x6f,0x73,0x68,0x6f,0x77,0x3a,0x79,0x65,0x73,0x3b,0x0d,0x0a,0x09,0x6d,0x73,0x6f,0x2d,0x73,0x74,0x79,0x6c,0x65,0x2d,0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79,0x3a,0x39,0x39,0x3b,0x0d,0x0a,0x09,0x6d,0x73,0x6f,0x2d,0x73,0x74,0x79,0x6c,0x65,0x2d,0x6c,0x69,0x6e,0x6b,0x3a,0x22,0x50,0x6c,0x61,0x69,0x6e,0x20,0x54,0x65,0x78,0x74,0x20,0x43,0x68,0x61,0x72,0x22,0x3b,0x0d,0x0a,0x09,0x6d,0x61,0x72,0x67,0x69,0x6e,0x3a,0x30,0x63,0x6d,0x3b,0x0d,0x0a,0x09,0x6d,0x73,0x6f,0x2d,0x70,0x61,0x67,0x69,0x6e,0x61,0x74,0x69,0x6f,0x6e,0x3a,0x77,0x69,0x64,0x6f,0x77,0x2d,0x6f,0x72,0x70,0x68,0x61,0x6e,0x3b,0x0d,0x0a,0x09,0x66,0x6f,0x6e,0x74,0x2d,0x73,0x69,0x7a,0x65,0x3a,0x31,0x30,0x2e,0x30,0x70,0x74,0x3b,0x0d,0x0a,0x09,0x6d,0x73,0x6f,0x2d,0x62,0x69,0x64,0x69,0x2d,0x66,0x6f,0x6e,0x74,0x2d,0x73,0x69,0x7a,0x65,0x3a,0x31,0x30,0x2e,0x35,0x70,0x74,0x3b,0x0d,0x0a,0x09,0x66,0x6f,0x6e,0x74,0x2d,0x66,0x61,0x6d,0x69,0x6c,0x79,0x3a,0x22,0x56,0x65,0x72,0x64,0x61,0x6e,0x61,0x22,0x2c,0x73,0x61,0x6e,0x73,0x2d,0x73,0x65,0x72,0x69,0x66,0x3b,0x0d,0x0a,0x09,0x6d,0x73,0x6f,0x2d,0x66,0x61,0x72,0x65,0x61,0x73,0x74,0x2d,0x66,0x6f,0x6e,0x74,0x2d,0x66,0x61,0x6d,0x69,0x6c,0x79,0x3a,0x43,0x61,0x6c,0x69,0x62,0x72,0x69,0x3b,0x0d,0x0a,0x09,0x6d,0x73,0x6f,0x2d,0x66,0x61,0x72,0x65,0x61,0x73,0x74,0x2d,0x74,0x68,0x65,0x6d,0x65,0x2d,0x66,0x6f,0x6e,0x74,0x3a,0x6d,0x69,0x6e,0x6f,0x72,0x2d,0x6c,0x61,0x74,0x69,0x6e,0x3b,0x0d,0x0a,0x09,0x6d,0x73,0x6f,0x2d,0x62,0x69,0x64,0x69,0x2d,0x66,0x6f,0x6e,0x74,0x2d,0x66,0x61,0x6d,0x69,0x6c,0x79,0x3a,0x22,0x54,0x69,0x6d,0x65,0x73,0x20,0x4e,0x65,0x77,0x20,0x52,0x6f,0x6d,0x61,0x6e,0x22,0x3b,0x0d,0x0a,0x09,0x6d,0x73,0x6f,0x2d,0x62,0x69,0x64,0x69,0x2d,0x74,0x68,0x65,0x6d,0x65,0x2d,0x66,0x6f,0x6e,0x74,0x3a,0x6d,0x69,0x6e,0x6f,0x72,0x2d,0x62,0x69,0x64,0x69,0x3b,0x0d,0x0a,0x09,0x6d,0x73,0x6f,0x2d,0x66,0x61,0x72,0x65,0x61,0x73,0x74,0x2d,0x6c,0x61,0x6e,0x67,0x75,0x61,0x67,0x65,0x3a,0x45,0x4e,0x2d,0x55,0x53,0x3b,0x7d,0x0d,0x0a,0x2d,0x2d,0x3e,0x0d,0x0a,0x3c,0x2f,0x73,0x74,0x79,0x6c,0x65,0x3e,0x0d,0x0a,0x3c,0x2f,0x68,0x65,0x61,0x64,0x3e,0x0d,0x0a,0x0d,0x0a,0x3c,0x2f,0x68,0x74,0x6d,0x6c,0x3e,0x0d,0x0a))
Set-ItemProperty -path ./ -Name ‘TextFontSimple’ -Value ([byte[]](0x3c,0x00,0x00,0x00,0x1f,0x00,0x00,0xf8,0x00,0x00,0x00,0x40,0xc8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x22,0x56,0x65,0x72,0x64,0x61,0x6e,0x61,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00))

@Jason275 

 

Hi Jason - sorry about the slow reply - been tied up on projects.

 

When deploying registry settings via MEM (Intune) as a win32app the registry values are actually written to the WOW6432Node - as the win32apps scripts are run in 32bit PowerShell not in the native 64 bit.

 

Use this code below in the script to relaunch the script in a 64 bit console. Note: the SysNative path only exist when the 32bit session is running :)

# If we are running as a 32-bit process on an x64 system, re-launch as a 64-bit process
if ("$env:PROCESSOR_ARCHITEW6432" -ne "ARM64")
{
    if (Test-Path "$($env:WINDIR)\SysNative\WindowsPowerShell\v1.0\powershell.exe")
    {
        & "$($env:WINDIR)\SysNative\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -ExecutionPolicy bypass -File "$PSCommandPath"
        Exit $lastexitcode
    }
}

 

@SteveMacNZ

Hi Steve, thank you so much for this! I can now successfully run the script and make the changes to the registry on all of the devices through MEM. Thanks again for all your help with this.

@Jason275 

 

How did you fix it? Can you please share the whole script? I am trying the same without luck :(

@Jason275 @SteveMacNZ I also like to have Arial 10 on all 3 but i can't seem to find the right bits/ How did you got the code for the font? Could you please advice?

@Aaron89 

 

Hi Aaron - you might find it easier to follow my original solution where you edit the existing Normal.dotm and NormalEmail.dotm files and make your changes and save the updated files to a new location. the Templates are located under %Appdata%\Microsoft\Templates and you right click on the .dotm file and select "open" not the default "new" - new will create a copy of the template as a new document - where open opens the actual template.

 

then the script to actually copy the files is simple compared to setting via registry 

(there was a typo in the original where i used Normal.dotx - which i have corrected below and expanded out with creating a detection file)

 

# Variables
$Script:dest = "$($env:ProgramData)\MEM\OfficeTemplates"
$Script:GUID = 'GUID using New-Guid'

# Test and create paths and detection .tag file for MEM detection
if (-not (Test-Path $Script:dest)){
    New-Item -Path $Script:dest -ItemType Directory 
}
if (-not (Test-Path "$Script:dest\OffTemp.tag")){
    Set-Content -Path "$Script:dest\OffTemp.tag" -Value "$Script:GUID" 
}

# Copy the Templates to the local device
copy-item -path .\Normal.dotm -destination $env:Appdata\Microsoft\Templates -force
copy-item -path .\NormalEmail.dotm -destination $env:Appdata\Microsoft\Templates -force

 I also write a transcription log to the destination folder as well so you can see what is going on (these just a subset of the script logic I use.  Feel free to grab a copy of the PowerShell template from my GitHub if you like PowerShell_Templates/Templates at main · SteveMacNZ/PowerShell_Templates · GitHub

@SteveMacNZ Hi Steven, thank you for the reply!

 

The document templates are already fixed. The only thing we want to change is the Outlook email font. Jason fixed it with his script, and i can deploy it as a intunewin package, but i can't find the right code for Arial and 10 size.

 

I checked it, but your script doens't work for the default font in Outlook. Atleast not for me :(

 

Regards Aaron

@Aaron89 

 

Hi Aron,

The script below will work. First you need to go to Outlook on your local device and set the default font to Arial 10, this will set the values in the registry. Then go to the registry and copy the values from HKCU:\SOFTWARE\Microsoft\Office\16.0\Common\MailSettings and replace the ones I have used in the example below. I have also included the write-output "Script worked" | out-file c:\Scripts\output.txt so you can see if the script has worked. This should give you what you need. 

 

Outlook Font Script.png

@Jason275 : Can you please add the full code here. I would prefer in text format instead of an image.

Thanks.

 

@Jason275 How do you export the reg keys in the format that you have? When i export the data, i get a very long code and its not recognized. 

@Aaron89, I have managed to change the default font for Outlook.

 

Is there any way if I can change the default font for Word and Powerpoint too?

How did you do it?