【问题标题】:Modifying PowerShell script to change the default Font type and size for Outlook修改 PowerShell 脚本以更改 Outlook 的默认字体类型和大小
【发布时间】:2020-01-30 14:18:18
【问题描述】:
我们在我们的环境中使用 Azure Intune,我正在尝试通过 Intune 使用 PowerShell 命令将“新邮件”和“回复或转发邮件”的默认字体更改为 Arial 11。
这可以通过 PowerShell 完成吗?
我们使用的是 Outlook 365,因此没有许可服务器/交换,我们使用的是 Windows 10 Pro。
【问题讨论】:
标签:
azure
powershell
outlook
exchange-server
intune
【解决方案1】:
正如 Matthew 所说,您可以使用Set-MailboxMessageConfiguration PS 命令来执行此操作。
我已经测试过,它对我有用:
试试下面的命令:
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session -DisableNameChecking
Set-MailboxMessageConfiguration <account you want to config> -DefaultFontName Arial -DefaultFontSize 11
【解决方案2】:
Stanley Gong 的 answer 仅适用于 Outlook Web App - 此外,您可以通过以下方式对所有邮箱执行此操作:
Import-Module ExchangeOnlineManagement
Connect-ExchangeOnline -UserPrincipalName <yourUPN> -ShowProgress $true
$mailboxes=get-mailbox
$aliases=$mailboxes.alias
$number= ($aliases).count
foreach ($alias in $aliases)
{
set-MailboxMessageConfiguration -Identity $alias -defaultfontname 'Arial' -defaultfontsize 11
#Inplace of Font 'Futura LT Book' you can replace with your own.
#get-MailboxMessageConfiguration -Identity $alias | ft identity, defaultfontname
#Check the validity of the configuration. Note: Disable Set while checking fonts
write-host 'Font has been Configured for' $alias
}
Write-host 'Total changes made is' $number