ultimatepie Posted June 20, 2024 Posted June 20, 2024 Comprehensive Script for Office and Outlook Let's refine our approach to ensure it sets the default font for Word, Excel, PowerPoint, and Outlook more effectively. PowerShell Script Here’s an enhanced PowerShell script that should cover all bases: powershell Copy code # PowerShell script to set default font to Calibri for Office 365 applications # Function to create or update registry keys function Set-RegistryKey { param ( [string]$Path, [string]$Name, [string]$Value, [Microsoft.Win32.RegistryValueKind]$Type = [Microsoft.Win32.RegistryValueKind]::String ) if (-Not (Test-Path $Path)) { New-Item -Path $Path -Force | Out-Null } Set-ItemProperty -Path $Path -Name $Name -Value $Value -Type $Type } # Set default font for Word $wordKeyPath = "HKCU:\Software\Microsoft\Office\16.0\Word\Options" Set-RegistryKey -Path $wordKeyPath -Name "DefaultFontName" -Value "Calibri" Set-RegistryKey -Path $wordKeyPath -Name "DefaultFontSize" -Value "11" # Set default font for Excel $excelKeyPath = "HKCU:\Software\Microsoft\Office\16.0\Excel\Options" Set-RegistryKey -Path $excelKeyPath -Name "DefaultFontName" -Value "Calibri" Set-RegistryKey -Path $excelKeyPath -Name "DefaultFontSize" -Value "11" # Set default font for PowerPoint $pptKeyPath = "HKCU:\Software\Microsoft\Office\16.0\PowerPoint\Options" Set-RegistryKey -Path $pptKeyPath -Name "DefaultFontName" -Value "Calibri" Set-RegistryKey -Path $pptKeyPath -Name "DefaultFontSize" -Value "11" # Set default font for Outlook - compose and reply $outlookKeyPath = "HKCU:\Software\Microsoft\Office\16.0\Common\MailSettings" Set-RegistryKey -Path $outlookKeyPath -Name "ComposeFontComplex" -Value "Calibri" Set-RegistryKey -Path $outlookKeyPath -Name "ComposeFontSimple" -Value "Calibri" Set-RegistryKey -Path $outlookKeyPath -Name "ComposeFontSize" -Value "11" Set-RegistryKey -Path $outlookKeyPath -Name "ReplyFontComplex" -Value "Calibri" Set-RegistryKey -Path $outlookKeyPath -Name "ReplyFontSimple" -Value "Calibri" Set-RegistryKey -Path $outlookKeyPath -Name "ReplyFontSize" -Value "11" # Additional Outlook settings for new and existing emails $outlookFontKeys = @( "NewMailFont", "ReplyFont", "PlainTextFont" ) foreach ($key in $outlookFontKeys) { Set-RegistryKey -Path $outlookKeyPath -Name "${key}Name" -Value "Calibri" Set-RegistryKey -Path $outlookKeyPath -Name "${key}Size" -Value "11" Set-RegistryKey -Path $outlookKeyPath -Name "${key}CharSet" -Value 1 -Type ([Microsoft.Win32.RegistryValueKind]::DWord) Set-RegistryKey -Path $outlookKeyPath -Name "${key}PitchAndFamily" -Value 0 -Type ([Microsoft.Win32.RegistryValueKind]::DWord) } Write-Output "Default font set to Calibri for Word, Excel, PowerPoint, and Outlook." Deployment Steps via Intune Save the Script: Save the PowerShell script as SetDefaultFont.ps1. Open Microsoft Endpoint Manager Admin Center: Go to the Microsoft Endpoint Manager admin center. Create a New PowerShell Script Deployment: Navigate to Devices > Windows > PowerShell Scripts. Click Add. Configure the PowerShell Script: Name: Provide a name for the script (e.g., "Set Default Font to Calibri"). Description: Optionally, add a description. Script location: Upload the SetDefaultFont.ps1 file. Run this script using the logged on credentials: Choose Yes if the script requires user context (for example, modifying HKCU keys). Otherwise, select No. Enforce script signature check: Choose No unless you have signed the script. Run script in 64-bit PowerShell: Choose Yes. Assign the Script to Devices or Users: Click Next. Under Assignments, select the groups of devices or users you want to apply the script to. Click Next, review the settings, and click Add. 1
Ratcliffepg Posted June 21, 2024 Posted June 21, 2024 Set-RegistryKey -Path $outlookKeyPath -Name "${key}CharSet" -Value 1 -Type ([Microsoft.Win32.RegistryValueKind]:Word) Set-RegistryKey -Path $outlookKeyPath -Name "${key}PitchAndFamily" -Value 0 -Type ([Microsoft.Win32.RegistryValueKind]:Word) I am guessing the "big Grin" would be a different character. Excellent script !
dj56 Posted September 17, 2024 Posted September 17, 2024 When I modify and run this in PowerShell ISE before testing with Intune it does not change the fonts to Arial 12 after opening a blank doc in word or composing a new email. What could I be doing wrong testing this locally before uploading to Intune?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now